How to List and Show WordPress Posts That Comments and Pings Off (Not Allow)
WordPress blog publishing platform allows individual author to override global discussion setting and set whether to allow reader to post comment on the article, or whether to allow link notification (aka pingback and trackback) from other blogs at single post or page level. The feature allows all new posts and pages to be created with comments and pings on, but can always be turned off on specific posts or pages when needed.
When come to time to housekeeping, WordPress does not provide an easy way to list or show all posts or paged articles that has its comments and pings off. For blog administrators who want to see a list blog posts and articles that have forbid readers and visitors to leave comments, and stop other blogs to pingback or trackback, use the following trick to list out all posts and pages that are currently set to comment and pingback/trackback off.
Log on to the MySQL database that powers the WordPress blog, and then use the following SQL query statement to get all posts or pages that either comment is not allowed, pings (trackback and ping back) is not allowed or both.
SELECT * FROM `wp_posts` where `comment_status` <> 'open' or `ping_status` <> 'open';
Tip: To make the selection from database easier, it’s recommended to use phpMyAdmin or other GUI interface to MySQL DB.
The query above will return all row (both posts and pages in WordPress) that has either “Allow Comments” or “Allow Pings” set to off (untick). To return only articles where comments is not allowed, use only “comment_status”, or “ping_status” for articles that do not allow pingback and trackback.
Both comment_status and ping_status fields have only two easily understand values – open and closed. Open means allow, which closed means disallowed. Once the result is displayed, the posts that have one or both of the criteria can be determined, and changed if required.
Related Articles
- Integrate WordPress including Comments with bbPress Forum using bbSync
- 3 Column Relaxation WordPress Theme comments-paged.php for Paged-Comments WordPress Plugin
- Useful WordPress Plugins At A Glance
- Reduce Server Load Using Akismet to Automatically Discard Spam Comments on Posts Older than A Month
- WordPress 2.2 Released for Free Download
- Replace Google Blog Search with Technorati for Incoming Links in Dashboard of WordPress
- Free Download: WordPress 2.1 with Autosave and Tabbed Editor
- Add and Insert to Put Google AdSense Ads Units Between Blog Posts in Blogger.com
- Retrieve and Get WordPress Post ID Outside the Loop as PHP Variable
- Free Download: Akismet for WordPress Plugin 2.0 to Stop Comment, Trackback and Pingback Spam










































November 19th, 2009 02:06
Now I see which do and don’t allow pings. But I also noticed in the database that “wp_posts” also includes images (.jpg) and the images all say “closed” for ping status. There is also a column “to_ping” and a column “pinged”, which I do not know what these signify.
So my question is – now that I know my images all say “closed” and I WANT my images to be pinged….so how to change them to “open”?
On another note, do you know why the images would be set to “closed”?
Thank you.
March 3rd, 2009 17:46
Great………… thanks man………………………………………..