Fine-grained comment and ping control for WordPress, without the usual noise.
This plugin lets me override WordPress’ global Discussion settings on a per-post basis.
Per post. Per page. Per any public post type that supports comments.
Sometimes I want comments off across the whole site but open on one key article.
Sometimes I want the opposite.
Core WordPress makes that possible, but not exactly obvious or consistent, especially once Gutenberg gets involved.
So I wired in a clean, explicit override layer.
For each supported post type, I get:
-
Comments:
- Use global setting
- Always allow
- Always disallow
-
Pings / trackbacks:
- Use global setting
- Always allow
- Always disallow
If I don’t touch anything, the global Discussion settings keep doing their job.
If I do, my choice wins.
No settings page. No JS build step. No “options framework”. Just a small meta box that does the work.
- Per-post and per-page overrides for:
- Comments
- Pings / trackbacks
- Automatically available on all public post types that support comments.
- Keeps the database clean:.
- “Use global setting” is never stored as meta.
- Defensive coding:
- Nonces, capability checks, sanitisation.
- Works in Classic Editor and Block Editor.
- No front-end templates, no theme lock-in.
- Drop the folder into
wp-content/plugins/post-discussion-toggle
or clone the repository there. - Activate Post Discussion Toggle in the WordPress admin.
- Edit any post, page., or other public post type that supports comments.
- In the sidebar, look for Discussion controls.
- Pick what you want:
- Use global setting
- Always allow
- Always disallow
That’s it. No extra setup..
- If I set Use global setting, the plugin deletes any override meta and lets WordPress decide.
- If I set Always allow, the plugin forces
comments_open()/pings_open()to returntruefor that post. - If I set Always disallow, the plugin forces them to return
false.
The override is applied using the comments_open and pings_open filters, so anything that respects those (themes, plugins, core) will see the correct state.
If a theme bypasses the proper APIs and hardcodes logic, that’s on the theme.
Things I may or may not add later:
- A small settings page for:
- Per post-type defaults (e.g. pages closed by default, posts open by default).
- Quick Edit / Bulk Edit support so I can flip lots of posts in one go.
- Gutenberg sidebar panel using
register_post_meta()withshow_in_rest.
The current version deliberately stays minimal so it doesn’t drag unnecessary complexity into simple sites.
- Trackbacks are a legacy thing. The plugin still respects them for the handful of use cases where they matter. or might in the future.
- If another plugin or theme aggressively overrides
comments_open()orpings_open()after my filters, it can win. That’s how the hook system works.
post-discussion-toggle/
├── post-discussion-toggle.php
├── README.md
├── CHANGELOG.md
├── LICENSE
├── .gitignore
└── languages/
└── (placeholder for translation files)