# Formatting posts to look more like Wordpress blog

**URL:** https://meta.discourse.org/t/formatting-posts-to-look-more-like-wordpress-blog/301133
**Category:** Support
**Tags:** wordpress
**Created:** [March 27, 2024, 11:03am UTC](https://meta.discourse.org/t/formatting-posts-to-look-more-like-wordpress-blog/301133 "2024-03-27T11:03:31Z")
**Posts on this page:** 11
**Page:** 1

<div class="post-metadata">

### Author: ![anon48433008](https://avatars.discourse-cdn.com/v4/letter/a/22d042/32.png) [@anon48433008](https://meta.discourse.org/u/anon48433008)
#### Post date: [March 27, 2024, 11:03am UTC](https://meta.discourse.org/t/formatting-posts-to-look-more-like-wordpress-blog/301133/1 "2024-03-27T11:03:31Z")

</div>

How can I, if at all, make the Discourse format like the blog post?

My blog

[![image](https://global.discourse-cdn.com/meta/original/4X/9/c/1/9c14aa8623ee9c57d554ce58cd0bc90a9f9915a8.png)](https://blog.full30.com/outer-darkness-iii-adulterous-and-sinful-generation/)

My discourse

[![image](https://global.discourse-cdn.com/meta/original/4X/4/b/7/4b755b12d16eec67457f6a7b56dcbc907e36e220.png)](https://forum.full30.com/t/outer-darkness-iii-adulterous-and-sinful-generation/22824)

also the verse block in wordpress

 ![image](https://global.discourse-cdn.com/meta/original/4X/9/4/8/94830d2da58d990869a1560fbce1c7ae7cd68ac3.png)

does not format over

![image](https://global.discourse-cdn.com/meta/original/4X/c/2/d/c2d808b24124a06b6b3d3aa873ba5111c7d78877.png)

fortunately it does not post as listed and gives me time to dr. it up a bit with an image from the blog so it looks more like the blog

---

<div class="post-metadata">

### Author: ![merefield](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/merefield/32/176214_2.png) [@merefield](https://meta.discourse.org/u/merefield)
#### Post date: [March 27, 2024, 11:08am UTC](https://meta.discourse.org/t/formatting-posts-to-look-more-like-wordpress-blog/301133/2 "2024-03-27T11:08:03Z")

</div>

> [@News Plugin newspaper](https://meta.discourse.org/t/news-plugin/107971):
>
> The News Plugin adds a new “News” route to your forum. The latest topics in a category(s) (or from an RSS feed) are displayed in a large, news-like format, with an optional sidebar with a topic list. It adds a link to the News route in the header bar. It is inspired by the [Elektronauts news feed](https://www.elektronauts.com/news). [page_facing_up Get the code](https://github.com/paviliondev/discourse-news)[bug Report a bug](https://discourse.pluginmanager.org/w/bug-report)Lost? Not sure how to install a plugin? [Follow the steps here](https://meta.discourse.org/t/install-plugins-in-discourse/19157). Make sure you check out all the site se…

News Plugin does this?

(Just needs a little fixing up if you have the time or money)

---

<div class="post-metadata">

### Author: ![jimkleiber](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jimkleiber/32/121814_2.png) [@jimkleiber](https://meta.discourse.org/u/jimkleiber)
#### Post date: [March 27, 2024, 3:23pm UTC](https://meta.discourse.org/t/formatting-posts-to-look-more-like-wordpress-blog/301133/3 "2024-03-27T15:23:10Z")

</div>

If you know a little bit of coding, I might be able to help point you in the right direction.

I don’t know off the top of my head but it might either be editing the CSS of your Discourse forum or editing the HTML/PHP that gets sent from Wordpress to Discourse (I assume you’re using the Discourse plugin on WP), or both.

Could you share links to your WP site and your discourse forum here (or privately in a message to me) so I can take a look to see what’s happening?

---

<div class="post-metadata">

### Author: ![anon48433008](https://avatars.discourse-cdn.com/v4/letter/a/22d042/32.png) [@anon48433008](https://meta.discourse.org/u/anon48433008)
#### Post date: [March 27, 2024, 6:48pm UTC](https://meta.discourse.org/t/formatting-posts-to-look-more-like-wordpress-blog/301133/4 "2024-03-27T18:48:48Z")

</div>

> [@merefield](#):
>
> News Plugin

No, haven’t looked at that yet

> [@jimkleiber](#):
>
> WP site

[https://blog.full30.com/outer-darkness-iii-adulterous-and-sinful-generation/](https://blog.full30.com/outer-darkness-iii-adulterous-and-sinful-generation/)

And the discourse post I did alter already, perhaps you can view the change log to view any necessary code?

> **[Sixguns Firearm Fraternity](https://sixguns.com/)**
>
> SIXGUNS is a self-supporting firearms community powering Kilroy, the first member-built 2A Artificial Intelligence assistant.

 ![image](https://global.discourse-cdn.com/meta/original/4X/4/c/e/4ced1065725b520ee2c4ac1bd033c5e8c80bb093.png)

---

<div class="post-metadata">

### Author: ![Heliosurge](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/heliosurge/32/571810_2.png) [@Heliosurge](https://meta.discourse.org/u/Heliosurge)
#### Post date: [March 27, 2024, 8:39pm UTC](https://meta.discourse.org/t/formatting-posts-to-look-more-like-wordpress-blog/301133/5 "2024-03-27T20:39:14Z")

</div>

Not sure if this #Customization > Theme component that be of interest

> [@Blog Post Styling](https://meta.discourse.org/t/blog-post-styling/110841):
>
> discourseSummary Blog Post Styling lets you designate a blog category, which alters the look of topics within the category to look more like traditional blog posts.eyeglassesPreview [Preview on theme-creator.discourse.org](https://discourse.theme-creator.io/t/a-quiet-desert-sunset/1115)hammer_and_wrenchRepository [github.com/discourse/discourse-blog-post-styling](https://github.com/discourse/discourse-blog-post-styling)open_bookNew to Discourse Themes? [Beginner’s guide to using Discourse Themes](https://meta.discourse.org/t/beginners-guide-to-using-discourse-themes/91966) Install this theme component The Blog Post Styling theme component transforms Discourse t…

---

<div class="post-metadata">

### Author: ![jimkleiber](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jimkleiber/32/121814_2.png) [@jimkleiber](https://meta.discourse.org/u/jimkleiber)
#### Post date: [March 28, 2024, 1:53am UTC](https://meta.discourse.org/t/formatting-posts-to-look-more-like-wordpress-blog/301133/6 "2024-03-28T01:53:56Z")

</div>

Soooo the problem seems to be that your Wordpress post has HTML classes, which are successfully being pasted to the Discourse post (as is shown in the raw HTML you posted from Discourse), however, when Discourse is _displaying_ the post, it strips out the HTML classes:

> [@What are the different ways to customize content inside a post (custom attributes and such)](https://meta.discourse.org/t/what-are-the-different-ways-to-customize-content-inside-a-post-custom-attributes-and-such/226747/5):
>
> It is possible to uses some HTML classes in Discourse, however, most HTML in a post is sanitized for security reasons, and only very strict whitelisted HTML is allowed in markdown. To add classes to the white-list you must use a plugin, the sanitization happens server side as well as client side. Check out [Whitelisting HTML tags / attributes](https://meta.discourse.org/t/whitelisting-html-tags-attributes/159653) for some details on where to add the whitelisted attributes, and I believe it would look similar to something like this: [Discourse HTML Whitelist](https://github.com/pnewell/discourse-html-whitelist). and a…

And this is some more info on creating a plugin to make this happen:

> [@Whitelisting HTML tags / attributes](https://meta.discourse.org/t/whitelisting-html-tags-attributes/159653):
>
> I vaguely remember that there was a way - using a site setting or a plugin - to add entries to the whitelist of allowed HTML tags and attributes ([https://github.com/discourse/discourse/blob/master/app/assets/javascripts/pretty-text/addon/white-lister.js](https://github.com/discourse/discourse/blob/master/app/assets/javascripts/pretty-text/addon/white-lister.js)). I’m not very familiar with the internals of this part of Discourse. Does anyone have some pointers on how to add to this list using a plugin or maybe even site settings?

I’m not sure what the easiest solution would be for you. I personally wish it were much easier to whitelist HTML classes so that we wouldn’t have to create custom plugins each time we want to whitelist an HTML class.

If you can figure out how to make the classes not get stripped when the post is displayed, then after that you’d have to make sure that Discourse has the proper CSS for the HTML elements you have on your Wordpress site.

---

<div class="post-metadata">

### Author: ![anon48433008](https://avatars.discourse-cdn.com/v4/letter/a/22d042/32.png) [@anon48433008](https://meta.discourse.org/u/anon48433008)
#### Post date: [March 28, 2024, 10:02am UTC](https://meta.discourse.org/t/formatting-posts-to-look-more-like-wordpress-blog/301133/7 "2024-03-28T10:02:42Z")

</div>

> [@Heliosurge](#):
>
> of interest

This seems to be pretty specific:

> topics within that category

And my blog articles are not limited to any categories

> [@jimkleiber](#):
>
> the problem seems to be

That’s really impressive you figured out the issue so seemingly easy 👏

> [@jimkleiber](#):
>
> create custom plugins

> [@jimkleiber](#):
>
> If you can figure out how to make the classes not get stripped

/deep exhale

At one point I would have dove in with a hammer and beat this to submission, these days religion and law dominate my study time, the fact you sound perplexed yourself, and I don’t do to many blog posts slows my roll.

But, with what you wrote on the need to whitelist my thinking causes me to question,

Could a whitelist rule be made from content of the wordpress plugin used for designing the post?

I believe mine come from spectra

> **[Website Builder: Create Lightning-Fast WordPress Websites](https://wpspectra.com)**
>
> Create Stunning Websites with Spectra Page Builder. No coding required! Build fast with pre-built websites. Start now!

I don’t see an easy export option, but do you think a whitelist rule could be made somehow based on spectra settings?

 ![image](https://global.discourse-cdn.com/meta/original/4X/e/0/c/e0c7250748af135bc0c27ffd9438f6657e124577.png)

Thanks all for your time, imagine if the world ran like this 🤔

---

<div class="post-metadata">

### Author: ![jimkleiber](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jimkleiber/32/121814_2.png) [@jimkleiber](https://meta.discourse.org/u/jimkleiber)
#### Post date: [March 28, 2024, 4:20pm UTC](https://meta.discourse.org/t/formatting-posts-to-look-more-like-wordpress-blog/301133/8 "2024-03-28T16:20:08Z")

</div>

To be honest, I’m not really sure what would be the best way to make it happen. I think it would require a custom plugin on Discourse that whitelists the HTML classes that you have.

It gave me an idea and I created a linked topic about how someone could create a Discourse plugin that would let help people on Wordpress have their posts show up the same way on Discourse, as I’ve wanted this option as well.

> [@Companion Discourse plugin for Wordpress](https://meta.discourse.org/t/companion-discourse-plugin-for-wordpress/301265):
>
> Continuing the discussion from [Formatting](https://meta.discourse.org/t/formatting/301133/6): From what I know, Discourse has a WordPress plugin, but WordPress does not have a companion Discourse plugin for WordPress. What I mean by this is a plugin I can install on Discourse that will modify Discourse to better work with WordPress. I never thought it would be needed, and I don’t really know what features it would have, but one that popped out to me is to be able to identify WordPress HTML classes to be used in Discourse posts so that when the…

Besides that, I’m not sure how to do it and I’m also trying to dive less into code these days and more into love, conflict resolution, emotional communication, and more.

> [@anon48433008](#):
>
> Thanks all for your time, imagine if the world ran like this 🤔

I’m glad I could help. One thing I love about this Meta community is that people have been so generous and giving here to help me, it has inspired me to give it forward. And I’m hoping (and working hard) to try to make the world run more like this in general 🙂

---

<div class="post-metadata">

### Author: ![anon48433008](https://avatars.discourse-cdn.com/v4/letter/a/22d042/32.png) [@anon48433008](https://meta.discourse.org/u/anon48433008)
#### Post date: [March 28, 2024, 6:58pm UTC](https://meta.discourse.org/t/formatting-posts-to-look-more-like-wordpress-blog/301133/9 "2024-03-28T18:58:41Z")

</div>

> [@jimkleiber](#):
>
> into love, conflict resolution, emotional communication

My first thought was to invite you to my forum, my second thought was of the people on my forum you’d run into and then I simultaneously chuckled out loud and became sad, there’s a duality for ya 😉

I’ll let your post run its course and close this one, thanks for posting the sentiment 🤗

---

<div class="post-metadata">

### Author: ![jimkleiber](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jimkleiber/32/121814_2.png) [@jimkleiber](https://meta.discourse.org/u/jimkleiber)
#### Post date: [March 30, 2024, 7:45pm UTC](https://meta.discourse.org/t/formatting-posts-to-look-more-like-wordpress-blog/301133/10 "2024-03-30T19:45:28Z")

</div>

> [@anon48433008](#):
>
> My first thought was to invite you to my forum, my second thought was of the people on my forum you’d run into and then I simultaneously chuckled out loud and became sad, there’s a duality for ya 😉

Haha, well, my perspective on love is that it’s not the absence of conflict but the ability to love through the conflict, so I’d be glad to join..not so sure how they’ll react though 🙂

---

<div class="post-metadata">

### Author: ![system](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/system/32/443519_2.png) [@system](https://meta.discourse.org/u/system)
#### Post date: [April 29, 2024, 7:46pm UTC](https://meta.discourse.org/t/formatting-posts-to-look-more-like-wordpress-blog/301133/11 "2024-04-29T19:46:19Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
