Custom Profile Link

AI-generated summary

chapoi introduces the Custom Profile Link theme component, which adds a customizable link to the user profile and usercard. Users can configure a prefix URL; if no specific user field is selected, it defaults to appending the username. Alternatively, it can pull data from a specific User Field to create links like github.com/CustomName. For advanced needs, chapoi points to a Multiple Custom Profile Links component.

Security and Formatting Concerns
mattdm raised concerns about spam, questioning if the links receive nofollow attributes or Akismet checks. Firepup650 noted a typo in the documentation (http://github/com/ vs http://github.com/) and questioned the use of HTTP over HTTPS for GitHub links. chapoi confirmed the typo and clarified there was no specific reason for using HTTP.

Discussion on User Fields and Clickability
Julian2 asked why a component is necessary when Discourse has User Fields, suggesting a native “link” field type would be better to avoid copy-pasting URLs. chapoi initially clarified that standard User Fields aren’t automatically clickable on profiles. After discussion, chapoi acknowledged the merit of the idea but stated that implementing it requires backend database changes beyond their current skill set. Julian2 subsequently posted a feature request for this functionality.

Technical Issues and Compatibility
Joseph_Tucker1 reported issues with trailing slashes in URLs and difficulties converting the plugin to a theme to fix JavaScript issues, sharing code attempts. Later, RGJ reported the component stopped working on v2025.11 due to a deprecation warning about array.filterBy. chapoi noted it was just a warning and RGJ later confirmed the issue was user error.

Fork Confusion
Web_SWLT reported an admin notice about code needing updates. david and chapoi suspected Web_SWLT had installed a similarly named fork (custom-profile-links instead of custom-profile-link) that contained deprecated code and had had its .hbs files removed. Web_SWLT confirmed they had indeed installed the wrong, forked version, which caused the confusion and deprecation warnings.

:discourse2: Summary Add a custom link to the user profile
:hammer_and_wrench: Repository GitHub - chapoi/discourse-profile-custom-link · GitHub
:question: Install Guide How to install a theme or theme component
:open_book: New to Discourse Themes? Beginner’s guide to using Discourse Themes

Install this theme component

A small component to add a customisable link on the user profile.

Shows on…

  1. The expanded user profile

  2. The usercard

Settings

If you leave profile custom link field empty, it will default using the username, so in the example case it would go to

http://github.com/charlie

If you want to use a custom user input field, you have to set the value to the exact name of the userfield, example:

  1. Create the user field

  2. Set setting to user field name

  3. Have users fill out the field
    /u/[username]/preferences/profile

Now it will go to http://github.com/MyRealGithubName


For a more advanced implementation, take a look at the Multiple Custom Profile Links component

24 Likes

Does this get “nofollow”? Will it be sent akismet?

This is definitely going to be used by spammers!

1 Like

Just a quick nitpick, that should be http://github.com/, right?

Also, any particular reason why this suggests http GitHub instead of https?

4 Likes

Haha yes, that’s a typo. Thanks. I’m not reinventing url structures here :winking_face_with_tongue:

Not at all

4 Likes

Hey @chapoi ! So glad I found this component. I’ve just added to our forum, thanks! I might even switch to the “multiple link” version.

Quick note: there is an extra “the” in the description text below the “profile custom link icon” field :slight_smile:

Is there a specific reason I have to add a component for this, instead of adding another field type for the User Fields?

Cheers

2 Likes

Nice catch. :+1: This should tidy it up:

https://github.com/discourse/discourse-profile-custom-link/pull/7

4 Likes

I’m not sure I follow the question. User fields aren’t all automatically shown on the profile or usercard.

2 Likes

Hey Charlie,
sorry for not being clearer. It would be great if there was a field type for user fields, that allows links instead of just text.

Or are we utilising User Fields all wrong? Here is how we are using them right now:

Links have to be copy-pasted instead of just being clickable.

1 Like

Ok now I follow, thanks!

Yeah, that’s actually a fair point you bring up. I’ll look into the possibility of your suggestion; my guess is that there is a reason why that wasn’t done, but I don’t know atm.

2 Likes

Awesome, thanks! :bouquet:

1 Like

So, I had a look but the necessary changes are way above my designer skills (read: backend databas-y stuff) – so I’m afraid it will be necessary to use the plugin.

An option you could consider is making a feature request, and seeing if that garners more interest.

Cheers!

2 Likes

This solution is great and I hope we can help improve it. Our profile link is of the form “https://www.domain.com/user/[USER-ID]/”. The trailing slash wrecks the solution for us. I can add a URL rewrite but a better solution would be to make the code more adaptive. I want working real links back to the site!

I tried to convert the plugin to a theme so I could improve the javascript but that CONVERT Discourse function doesn’t seem to be working.

Can you make the update so that it adds functionality?


import Component from "@glimmer/component";
import { tracked } from "@glimmer/tracking";
import { service } from "@ember/service";

export default class ProfileCustomLink extends Component {
  @service site;
  @tracked customLinkUrl;
  @tracked customLinkFieldId;
  @tracked showCustomLink = false;
  @tracked user = this.args.model.username;
  @tracked userFields = this.args.model.user_fields;

  constructor() {
    super(...arguments);

    if (settings.profile_custom_link_field) {
      const siteUserFields = this.site.user_fields;

      if (!siteUserFields) {
        return;
      }

      const customLinkField = siteUserFields.filterBy(
        "name",
        settings.profile_custom_link_field
      )[0];

      if (!customLinkField) {
        return;
      }

      this.customLinkFieldId = this.userFields[customLinkField.id];
      if (!this.customLinkFieldId) {
        return;
      } else {
        this.showCustomLink = true;
        if (settings.profile_custom_link_prefix.includes("[CUSTOM-LINK-FIELD-ID]")) {
          const url = settings.profile_custom_link_prefix.replace("[CUSTOM-LINK-FIELD-ID]", this.customLinkFieldId);
          this.customLinkUrl = url;
        } else {
          const url = settings.profile_custom_link_prefix + this.customLinkFieldId;
          this.customLinkUrl = url;
        }
      }
    } else {
      const url = settings.profile_custom_link_prefix + this.user;
      this.customLinkUrl = url;
      this.showCustomLink = true;
    }
  }
}

@Julian2 I have just posted a feature request for this here, didn’t see your posts on this topic

2 Likes

This component seems to have stopped working on v2025.11

[THEME 2 'Custom Profile Link'] Deprecation notice: The array.filterBy is a deprecated Ember native array extension. Use native array methods or a TrackedArray instead. [deprecated since Discourse 3.6.0.beta1-dev] [deprecation id: discourse.native-array-extensions.filterBy]

1 Like

I’m on 2025.12 and it still seems to work for me. That’s just a deprecated warning, not an error, so it should still be fine.

Can you tell me more about what you’re experiencing?

1 Like

Indeed, the actual issue turned out to be caused by a user error.

3 Likes

I have installed this and it’s exactly what I need to allow my members to link from their Discourse account to their member profile on our website. As an admin though, I’m seeing a warning: [Admin Notice] Theme ‘Custom profile links’ contains code which needs updating. (id:discourse.hbs-extension) (learn more) . Is this the appropriate place to ask for help in updating?

1 Like

Oh thanks for letting me know – I’ll take a look tomorrow. It’s probably an easy fix

It looks like the .hbs files were removed back in 2025: DEV: Update linting config and run gjs-codemod (#23) · chapoi/discourse-profile-custom-link@fc18b3e · GitHub

Could you double check you’re using the theme-component linked in the OP @Web_SWLT? I wonder if you have a similarly-named version from a different author :eyes:

I checked, and noticed that the admin message is gone.