Page Publishing

Thank you so much @Richie!! Out-of-the-Box is my entire World!


There’s a typo in your code, a double semicolon:

    .topic-body h1 {
        padding-top: 0 !important;;


Did you forget to post your image? Unless the After version of your page is just music :smile:

I played a bit with your code and that’s just :sparkles: brilliant! :sparkles:

We could add some advice for using this trick depending on your needs.

  • Your topics could be closed to prevent people circumvent the CSS rules and reply to them

  • Your topics could be unlisted to not add noise to topic lists or appear in the search results

  • The tags could be in a tag group invisible to regular users to remove noise in the tag lists

  • You could hide some elements only regular users but not for the admin (like the post menu)

That just came quickly to my mind, but I suppose there are other things that may be thought about.


Thanks @Canapin :sparkling_heart: I fixed the code typos.

Categories and Sub-Categories can also be used in CSS by using category-


.category-books .main-content,
.category-my-great-book .main-content {
    width:100% !important;

I’m also using this trick on my site extensively, to style content and embeds on-the-fly inside the composer…

I have a section of my site where I document my developments (mainly so my future self can recall and find what I have already done, so I don’t continue to reinvent my own wheels!) But anyone is welcome to visit and/or subscribe to that category if you’d like…


Oops; my adblocker somehow blocked your second image, weird.

For those who want to see the pages live:



This is awesome!!! Thank you for sharing!!! :star_struck:
This deserves it’s own “how-to” entry :ok_hand:


One obvious drawback to using CSS for “removing” content, is that it’s not actually removed, just hidden. Therefore you’re loading data that your client won’t be using.

My intention with this question below was to determine a common way for Discourse practitioners to recognize a way to the discussion across instances.


@hellekinacross instances” of what?

Are you using Wordpress?

… or Ghost?

There is a new, even tighter integration with Ghost and Discourse that enables Single Sign On…

There is also this plugin…


Across instances of Discourse.

Hello, I currently have a discourse site that requires login to see and do anything. I want to use the publish topic feature to create a homepage for my users but since I’m also using secure media, I’m getting the below error. Is there anyway around this? I tried the procourse-static-pages (doesn’t work with the latest version of discourse, I’m unable to save a new page. The security group drop down box is not being populated so that might be the issue) and discpage (doesn’t seem to work with a custom theme I’m using) plugins. So I’m really hoping I can get this feature to work. Does anyone have any advice?


What an amazing tweak you’ve made out of Discourse, congrats and thanks for sharing :)

1 Like

this is very cool. well done and thank you for sharing :+1:

1 Like

Thanks, @brasofilo and @Lilly! I’m planning some Theme Components based on this, and related use cases.


Unless I missed something on this feature, the published page only shows the initial post, not the answers to it. If that’s the intended behavior, is there a way (plugin?) to make the standalone page also show all the replies to the initial post?

Hi Raphael,

This is the purpose of published pages. :slight_smile:

Published page has limited access to many Discourse features.
The only workaround would be using a trick like Page Publishing - #145 by denvergeeks but the published page won’t have a custom URL (and will load useless thing in the background).

1 Like

Hello Danielle,
Unfortunately, I have no other advice than opening a new feature page-publishing topic and ask if something can be done about it.

Pay Publishing is a cool idea and feature that’s new to me and in particular the above is how I assumed it might work too.

This would opens up the ability to present content with more control while having the majority of your discourse logion_required, best of both world, you may still need to hook in new users or ut valuable information you want ot leave open to all on the web, including crawlers.

A simple option like:

Allow Published Pages Display on Login_required page

Would be a good start.

Maybe the /pub/ could also be a default landing page to display all pub pages in a simple list preview, as a matter of course.

I really didn’t know this feature was available until investigating login_required.

Indexing Published Pages

While we’re waiting for the Index or search published pages feature, here is a way to do it manually.

Finding Published Pages

Using the Discourse Data Explorer you can create a new Published Pages query:

SELECT CONCAT('/pub/', pp.slug) AS URL, pp.topic_id
FROM published_pages pp

Providing an Index

Surely one can Run Data Explorer queries with the Discourse API to create and maintain an index of published pages. This might even be doable with the Custom Wizard Plugin 🧙.

I manually created a new topic using the data from the Published Pages query above, then published it at /pub/index.

Since I Run other websites on the same machine as Discourse, I could easily make the published pages index available at https://discourse.example/pub with this snippet:

    # Provide an index to published pages
    location ~* ^/pub/?$ {
        return 307 https://discourse.example/pub/index;

Adding my name to this list :blush:

Is there a way to alter the routing to remove the /pub/ from the URL of the published page?

For example, this published page:

Would become:


1 Like

Hi @Richie - you can do this with permalinks (admin-customize-permalinks). Put the “my-magic-page-here” slug in the first field, use the External URL option in the drop down, then add the published page URL in the URL field. Note however, that the permalink won’t work as a URL in a custom menu section, still need the actual published doc URL.