# Using Wordpress Comments \*alongside\* Discourse

**URL:** https://meta.discourse.org/t/using-wordpress-comments-alongside-discourse/312786
**Category:** WordPress
**Created:** [June 19, 2024, 5:49pm UTC](https://meta.discourse.org/t/using-wordpress-comments-alongside-discourse/312786 "2024-06-19T17:49:45Z")
**Posts on this page:** 9
**Page:** 1

<div class="post-metadata">

### Author: ![Kayla](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/kayla/32/128523_2.png) [@Kayla](https://meta.discourse.org/u/Kayla)
#### Post date: [June 19, 2024, 5:49pm UTC](https://meta.discourse.org/t/using-wordpress-comments-alongside-discourse/312786/1 "2024-06-19T17:49:45Z")

</div>

It seems that once you ‘publish to Discourse,’ the Wordpress comment submit box disappears, even if you’ve unchecked use Ajax and you’ve opted not to remove Wordpress comments. Is it possible to allow visitors to leave Wordpress comments alongside the Discourse-linked discussion?

I’m going for

> [@Should Discourse make an effort to become a viable comment platform?](https://meta.discourse.org/t/should-discourse-make-an-effort-to-become-a-viable-comment-platform/274455/24):
>
> There are also some possible WordPress specific solutions. The simplest one being to enable WordPress comments _and_ the [WP Discourse](https://github.com/discourse/wp-discourse) plugin.

---

<div class="post-metadata">

### Author: ![angus](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/angus/32/341715_2.png) [@angus](https://meta.discourse.org/u/angus)
#### Post date: [June 20, 2024, 6:41am UTC](https://meta.discourse.org/t/using-wordpress-comments-alongside-discourse/312786/2 "2024-06-20T06:41:17Z")

</div>

Hello @Kayla. Is your Wordpress theme a block theme or a “classic” theme?

The recommended way of doing this is using a block theme. That way you have complete control over which comment blocks you put where and don’t have to worry about which template is overriding which. For example this comment block configuration (Wordpress comments followed by Discourse comments) on Wordpress’ current default theme (Twenty Twenty Four)

 ![Screenshot 2024-06-20 at 08.40.16](https://global.discourse-cdn.com/meta/original/4X/5/4/a/54ad49b256517a39aedf063c45559a3757107ad9.png)

Results in this

> **[A post with both types of comments – WP Discourse Test Site](https://wp-discourse.pavilion.tech/a-post-with-both-types-of-comments/)**

---

<div class="post-metadata">

### Author: ![Kayla](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/kayla/32/128523_2.png) [@Kayla](https://meta.discourse.org/u/Kayla)
#### Post date: [June 20, 2024, 8:01pm UTC](https://meta.discourse.org/t/using-wordpress-comments-alongside-discourse/312786/3 "2024-06-20T20:01:59Z")

</div>

Nice! Love that you put up a demo and everything, that’s _awesome_. ❤

Unfortunately the site in question is using a ‘classic’ Genesis Framework theme, and _further_ unfortunately, it is also making liberal use of Toolset archive templates, which cannot yet be replicated in a Site Editor/FSE theme.

I did some more playing around, and it seems to show both the Discourse replies (first) and WP comments (including the submit form!) if there’s at least 1 WP comment _before_ posting to Discourse. But if you publish/link to Discourse right away, WP commenting disappears. I’m wondering if this is the case even in the block themes? I see you have some WP comments in the demo showing–did you add those before or after posting to Discourse?

---

<div class="post-metadata">

### Author: ![angus](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/angus/32/341715_2.png) [@angus](https://meta.discourse.org/u/angus)
#### Post date: [June 21, 2024, 6:44am UTC](https://meta.discourse.org/t/using-wordpress-comments-alongside-discourse/312786/4 "2024-06-21T06:44:38Z")

</div>

> [@Kayla](#):
>
> I did some more playing around, and it seems to show both the Discourse replies (first) and WP comments (including the submit form!) if there’s at least 1 WP comment _before_ posting to Discourse

Interestingly enough, it looks like it’s designed to work that way. This is the relevant logic with readable names in place of the [real code](https://github.com/discourse/wp-discourse/blob/main/lib/discourse-comment.php#L323):

```plaintext
if ( "Show Existing WP Comments" is disabled or there's no Wordpress comments ) {
  return only Discourse comments
} else {
  return Discourse comments followed by Wordpress comments
}

```

Is think the “or there’s no Wordpress comments” part of the conditional could be safely removed if that would help you?

> [@Kayla](#):
>
> I’m wondering if this is the case even in the block themes?

The number or timing of different types of comments won’t effect anything in a block theme as the each block is a contained element, so you get what you see.

---

<div class="post-metadata">

### Author: ![Kayla](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/kayla/32/128523_2.png) [@Kayla](https://meta.discourse.org/u/Kayla)
#### Post date: [June 25, 2024, 9:45pm UTC](https://meta.discourse.org/t/using-wordpress-comments-alongside-discourse/312786/5 "2024-06-25T21:45:22Z")

</div>

Would I need to edit the plugin itself (and every time it’s updated) or is there a way to hook into this if-else statement to alter the IF part? It looks like this is indeed what I need to target.

---

<div class="post-metadata">

### Author: ![angus](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/angus/32/341715_2.png) [@angus](https://meta.discourse.org/u/angus)
#### Post date: [June 26, 2024, 7:02am UTC](https://meta.discourse.org/t/using-wordpress-comments-alongside-discourse/312786/6 "2024-06-26T07:02:08Z")

</div>

I’m going to look at just removing it in the plugin itself. Hang tight, I’ll let you know.

\*\*edit this change will be in the next version of the plugin (`2.5.4`)

---

<div class="post-metadata">

### Author: ![angus](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/angus/32/341715_2.png) [@angus](https://meta.discourse.org/u/angus)
#### Post date: [July 2, 2024, 10:48am UTC](https://meta.discourse.org/t/using-wordpress-comments-alongside-discourse/312786/7 "2024-07-02T10:48:07Z")

</div>

Just to close the loop on this, since version `2.5.4` the plugin no longer requires at least one existing comment to show Wordpress comments.

---

<div class="post-metadata">

### Author: ![Kayla](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/kayla/32/128523_2.png) [@Kayla](https://meta.discourse.org/u/Kayla)
#### Post date: [July 8, 2024, 6:54pm UTC](https://meta.discourse.org/t/using-wordpress-comments-alongside-discourse/312786/8 "2024-07-08T18:54:53Z")

</div>

I confirm that the latest version solves for having both WP & Discourse comments alongside each other for classic themes. Thanks so much!

---

<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: [August 7, 2024, 6:54pm UTC](https://meta.discourse.org/t/using-wordpress-comments-alongside-discourse/312786/9 "2024-08-07T18:54:57Z")

</div>

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