Facebook Twitter Instagram
    TecAdmin
    • Home
    • FeedBack
    • Submit Article
    • About Us
    Facebook Twitter Instagram
    TecAdmin
    You are at:Home»CMS»WordPress»How to Disable Pingbacks and Trackbacks in WordPress

    How to Disable Pingbacks and Trackbacks in WordPress

    By RahulJanuary 17, 20172 Mins ReadUpdated:April 19, 2020

    Many spammers used Pingbacks and Trackbacks to create spam content on your WordPress site. This tutorial will help you to disable pingbacks and trackbacks in WordPress. Also, remove old pingbacks and trackbacks from the database.

    Advertisement
    • Read: How to Disable Comments on Attachments in WordPress

    Disable Pingbacks and Trackbacks

    Use this option to disable pingbacks and trackbacks from new articles. Go to WordPress admin panel and then go Settings >> Discussion option. Now uncheck the box showing in below screenshot under Default article settings section.

    Disable Pingbacks and Trackbacks

    Disable for Existing Articles

    The above option will disable the pingbacks and trackbacks for new articles, but you still needs to disable it for existing articles. You can do this by directly querying the database. Change table name wp_posts with your table name if you are using a different prefix.

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

    Remove Pingbacks and Trackbacks

    Finally, you need to remote Pingbacks and Trackbacks from existing articles. Use below query to remote it. You may need to change table name wp_comments if using different table prefix.

    mysql> DELETE FROM  wp_comments WHERE  comment_type = 'trackback';
    

    Pingbacks Trackbacks WordPress
    Share. Facebook Twitter Pinterest LinkedIn Tumblr Email WhatsApp

    Related Posts

    10 Simple Ways to Speed Up Your WordPress Website

    10 Simple Ways to Speed Up Your WordPress Website

    How to Configure Nginx for WordPress Permalinks

    Update WordPress Ping List to Quick Index of Posts

    View 2 Comments

    2 Comments

    1. Scott on May 10, 2017 7:11 pm

      WordPress filters messed up my previous comment by removing the STYLE tags from the last line of code. Maybe one of these will display correctly…

      echo "\n label[for=\"ping_status\"] {display:none} \n";

      echo "\n<style> label[for=\"ping_status\"] {display:none} </style>\n";
      Reply
    2. Scott on May 10, 2017 7:03 pm

      You can also make it difficult (but not impossible) for editors to override the trackback/pingback setting by adding this to your theme’s functions.php file:

      add_action('admin_head', 'hide_trackpingback_checkbox');
      function hide_trackpingback_checkbox() {
        if ( $_SERVER['PHP_SELF'] == '/wp-admin/post.php' || $_SERVER['PHP_SELF'] == '/wp-admin/post-new.php' )
          echo "\n label[for=\"ping_status\"] {display:none} \n";
      }
      
      Reply

    Leave A Reply Cancel Reply

    Advertisement
    Recent Posts
    • Error: EACCES: permission denied, scandir (Resolved)
    • How To Install Python 3.11 on Ubuntu 22.04 / 20.04
    • How to Install Python 3.11 on Amazon Linux 2
    • An Introduction to the “./configure” Command: Compiling Source Code in Linux
    • How to Install PHP 8.x on Pop!_OS
    Facebook Twitter Instagram Pinterest
    © 2023 Tecadmin.net. All Rights Reserved | Terms  | Privacy Policy

    Type above and press Enter to search. Press Esc to cancel.