Skip Navigation

[Closed] Add comment moderation rules to custom post type

This support ticket is created 3 years, 1 month ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 - - 9:00 – 13:00
14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 - - 14:00 – 18:00

Supporter timezone: Africa/Casablanca (GMT+01:00)

This topic contains 5 replies, has 2 voices.

Last updated by Jamal 3 years, 1 month ago.

Assisted by: Jamal.

Author
Posts
#2173117

I built a custom post type with a default comment section.
I wanted to add some rules to monitor the comment language. I used WordPress-setting-discussion section to set the rules. The rules are successfully applied to WordPress default post.
However, the rules won't apply to my custom post type built with Toolset. If I use the banned words in the custom post type comment section, I can still publish it with no problem.
Could you please advise if there is a way to apply same rule to the custom post type?
Thanks!

#2173129

Hello and thank you for contacting Toolset support.

Please check if the solutions discussed in this StackExchange thread work for you https://wordpress.stackexchange.com/questions/39715/comment-moderation-on-custom-post-types

I hope this helps. Let me know if you have any questions.

#2173215

Hi Jamal,
Thanks for the link. But I think my issue is opposite of the scenario in the link. In the link, the author's moderation rules applied to all posts including the custom post type. The solution provided was to write a code to limit the rule to only custom post types.
In my case, my moderation rules are not applying to custom post types created with Toolset. But they do apply to other normal posts. So I'm wondering if there is any setting I can change to make my moderation rules also apply to Toolset custom post types.
Does it make sense?

#2173307

Well, my apologies if I did not see the difference between that case and yours, but I still think that the solution is similar to that. I still think that the solution is based on a similar snippet of code.

Toolset does not have any effects on comments at all. So, there is nothing from the Toolset settings that can affect that.

I am not very familiar with how commenting is moderated on WordPress. Honestly, I have no previous experience with it. Maybe if you can tell me the steps I can follow to reproduce the issue on a test site.

#2173851
Screenshot 2021-09-20 215451.jpg
Screenshot 2021-09-20 215353.jpg
Screenshot 2021-09-20 215304.jpg

Hi Jamal
So this is what I did:
1.In my WordPress admin-setting-discussion section, I ticked "comment must be manually approved".
2.Then I used my another account (not the admin acct) to run tests.
3.When I tried to leave offensive comments under a normal post (the wordpress default post type), the comment did not appear directly. Instead, it says the comment is pending approval.
4. However, when I went to another post type that I created with Toolset, the comment was not blocked. It appears on the site directly.
I have attached a few screenshots. Hope it helps.
Thanks!

#2174267

Thank you for the details. However, I could not reproduce this issue on my test site. After activating the option "comment must be manually approved" and sending a comment from a guest(non logged in) user, the comment was not automatically approved.

I tried again with a subscriber user, and the issue was not reproduced.

I am keen to think that a 3rd party component(theme/plugin/custom code) is probably the cause of this issue. Please check if this happens when:
- Only Toolset plugins are activated. It will tell us if there is an interaction issue with another plugin.
- The theme is set to a WordPress default like Twenty-Twenty. It will tell us if there is an interaction issue with your theme.
If the problem disappears, start activating one at a time to track where the incompatibility is produced.

The topic ‘[Closed] Add comment moderation rules to custom post type’ is closed to new replies.