Viewing 6 replies - 1 through 6 (of 6 total)
  • From my notes, these SQL statements. Backup your database first!!!

    UPDATE wp_posts SET comment_status='closed' WHERE post_status = 'publish' AND post_type = 'post';
    UPDATE wp_posts SET comment_status='open' WHERE post_status = 'publish' AND post_type = 'post';
    UPDATE wp_posts SET comment_status='closed' WHERE post_status = 'publish' AND post_type = 'page';

    ;
    `

    I ran this code in phpMyAdmin and it knocked my whole site offline. How can I undo what this has done? I got this information from HERE, and now all I get is a database error when I try to load the site. This is the error: Error establishing a database connection

    This is the code: UPDATE wp_posts SET comment_status=”closed”;

    Now my entire site is down. How can I fix this?

    Nevermind, I fixed the DB issue, but I would still like to UNDO what this query did. Can someone help please?

    Some people don’t read.

    Backup your database first!!!

    The link you posted previously looks like it’s working just fine. If you’re having problems writing new posts, check that your wp-config.php settings are correct.

    And honestly, MichaelH, you’re making this entirely too complicated.

    If you don’t want anyone to be able to comment on anything anywhere, just edit your theme’s index.php & other template pages and remove the code that inserts the comment form/link to begin with.

    Stuff like this (your own page code may differ):

    <?php comments_popup_link(‘No Comments »’, ‘1 Comment »’, ‘% Comments »’); ?>

    Moderator Samuel Wood (Otto)

    (@otto42)

    WordPress.org Admin

    If you don’t want anyone to be able to comment on anything anywhere, just edit your theme’s index.php & other template pages and remove the code that inserts the comment form/link to begin with.

    Won’t work. You’ll still get comment spam coming in that way, since spam bots don’t use your forms.

    To disable comments, you have to actually disable comments.

    The correct SQL to use:
    UPDATE wp_posts SET comment_status = 'closed', ping_status = 'closed' WHERE comment_status = 'open';

    While you are correct about the spam & that step would also be necessary, the question wasn’t about comment spam.

    The question was how to remove the comment field from the page.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Disable the comment field? possible??’ is closed to new replies.