• I have a WordPress website that is being spammed with Comments on my media uploads. I have disabled comments on future posts, but that doesn’t disable comments on my existing older media uploads. Luckily WordPress lets me do batch edits on my pages and posts to turn off all comments, but unfortunately this functionality does not exist for media uploads.

    Can anyone help me with the appropriate SQL command so I can fix this directly in the WordPress database?

Viewing 1 replies (of 1 total)
  • AddWeb Solution

    (@addweb-solution-pvt-ltd)

    Hi @mikeschumann,

    Certainly! To disable comments on your existing media uploads in WordPress, you can execute the following **SQL command** directly in your WordPress database:

    UPDATE wp_posts SET comment_status = 'closed' WHERE post_type = 'attachment' AND comment_status = 'open';

    This query will close the comment system for all uploaded images. Make sure to replace wp_posts with the actual table name in your WordPress installation. You can execute this command using **phpMyAdmin** or any other MySQL client¹. Keep in mind that modifying the database directly should be done with caution, and it’s always a good practice to back up your database before making any changes.

    Hope this helps! 🙂

Viewing 1 replies (of 1 total)

The topic ‘SQL to Disable Comments in Media Uploads’ is closed to new replies.