Set or update a featured topic link via the rails console

You can set or update a featured link on a topic by using the rails console.

From your server, enter the rails console from your Discourse folder:

./launcher enter app
rails c

You can then use the @nathank’s form to generate your command:

Topic.where(id: =topic_id=).update(featured_link: "=featured_link=")

Copy-paste the generated command inside your rails console and press Enter. It will set or update the featured link accordingly.


:information_source: Example of the raw syntax for the command:

Topic.where(id: 9999).update(featured_link: "https://blog.discourse.org/")
3 Likes