WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Globally disable pingback and trackback? (7 posts)

  1. unseenmortal
    Member
    Posted 4 years ago #

    I have hundreds of entries that has pingback and trackbacks checked, I want to disable all of them at once. Are there any ways to do it without me updating all my posts one by one? Please help me out, I need to disable it because some spammers are abusing it and its killing my server. Thanks in advance. :)

  2. MichaelH
    Member
    Posted 4 years ago #

    SQL to turn comments off on all posts and pages:

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

    Please backup your database before proceeding.

    Related:
    WordPress Backups
    Database Description
    phpMyAdmin

  3. MichaelH
    Member
    Posted 4 years ago #

    And of course don't forget to fix your settings in Administration > Settings > Discussion

  4. unseenmortal
    Member
    Posted 4 years ago #

    But I don't want to disable comments, I just want to disable pingbacks and trackbacks, should I just use the ones below?

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

    Thanks

    PS: you placed two 'page' on your ping status code. :)

  5. MichaelH
    Member
    Posted 4 years ago #

    Oops, messed up...try

    UPDATE wp_posts SET ping_status='closed' WHERE post_status = 'publish' AND post_type = 'post';
    UPDATE wp_posts SET ping_status='closed' WHERE post_status = 'publish' AND post_type = 'page';
  6. unseenmortal
    Member
    Posted 4 years ago #

    Worked perfectly MichaelH, now I have to find how to globally remove tags with zero posts. If you know a SQL magic, kindly please let me know, here's my thread..

    How to globally clean null or empty tags?

    http://wordpress.org/support/topic/311621

    Thanks in advance...

  7. sansatan
    Member
    Posted 4 years ago #

    I think there are two identical lines in the first sql sentences from MichaelH: Thirst and fourth lines.

    Perhaps the difference should be "page" and "post", and not "page" in both lines.

Topic Closed

This topic has been closed to new replies.

About this Topic