WordPress.org

Forums

[resolved] Mass edit of posts (to allow for comments)? (9 posts)

  1. No_No
    Member
    Posted 9 years ago #

    I currently have over 100 old posts that had comments disabled on them. As I get ready for major changes to my blog, I would like to also re-open all posts to allow for comments, should somebody wander through and have something catch their eye.

    The only way I have seen so far to do this is to edit each post individualy. This is taking quite some time and I was wondering if there is a way to set the "allow comments" for ALL posts at once?

  2. Cyndy Otty
    Member
    Posted 9 years ago #

    The only way I can think that you currently can do that is via a command in the database. I'm MySQL stupid, so someone else will have to give you the command to use....

  3. No_No
    Member
    Posted 9 years ago #

    Oh, I'm a MySQL nightmare so if that is the only way, I had better stick to a post-by-post edit.

  4. Miklos
    Member
    Posted 9 years ago #

    This is exactly what I had, and used SQL to change that. If you want to allow comments to all your posts, the SQL command is of the following form:

    UPDATE wp_posts SET comment_status = "open" ;

    Now, it depends if the tables making up your installation indeed start with the "wp_" prefix (this is the default, but you can set this to anything else at installation time, so check this).

    As to how to use the command, it depends what type of interface to MySQL you use. It could be in command mode (via a shell window), or through an interface such as phpMyAdmin (you may have to backquote the name of the table, like so: wp_posts, as well as that of the column: comment_status).

    Good luck

  5. spencerp
    Member
    Posted 9 years ago #

    Awesome! Worked like a charm! =D Except instead of enabling them all, I disabled them all!

    UPDATE wp_posts SET comment_status = "closed";

    Thanks for posting this Miklos... =)

    spencerp

  6. digink
    Member
    Posted 8 years ago #

    I would also like to open up my old posts for comments, but unfortunately I have no clue what I am doing here. Where do I enter this command using phpMyAdmin?

  7. spencerp
    Member
    Posted 8 years ago #

    digink, do you have the Database Manager plugin by GamerZ? If you do, as far as I know you could just use/run that query right inside the Blog's Control panel under the Database Manager section.. =/

    But for the phpMyAdmin, you click on the database you want in there, then click on the SQL Query tab at top of that database, and you should get a box with a "GO" button, you'd then just put that query in there, and click "GO".

    But as far as I know, the quicker way, should be the Database Manager plugin though..

    spencerp

  8. digink
    Member
    Posted 8 years ago #

    Don't have that plugin but I did find the query box you were talking about. Seems to have worked, thanks!

  9. spencerp
    Member
    Posted 8 years ago #

    Don't have that plugin but I did find the query box you were talking about. Seems to have worked, thanks!

    No problem.. =)

    spencerp

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags