Title: Disabling Pingbacks/Trackbacks on Pages
Last modified: August 20, 2016

---

# Disabling Pingbacks/Trackbacks on Pages

 *  [ghindo](https://wordpress.org/support/users/ghindo/)
 * (@ghindo)
 * [13 years, 2 months ago](https://wordpress.org/support/topic/disabling-pingbackstrackbacks-on-pages/)
 * I’ve been getting a lot of trackback spam lately on my site, but it’s all been
   through PAGES instead of POSTS.
 * I’ve got trackbacks disabled globally for posts for a while, but I haven’t figured
   out a way to disable trackbacks on PAGES.
 * A few support places have suggested disabling them through this SQL query:
 * `UPDATE wp_posts SET ping_status='closed' WHERE post_status = 'publish' AND post_type
   = 'page';`
 * . . . but I wanted to know if there were any other options out there.
 * Thanks!

Viewing 15 replies - 1 through 15 (of 16 total)

1 [2](https://wordpress.org/support/topic/disabling-pingbackstrackbacks-on-pages/page/2/?output_format=md)
[→](https://wordpress.org/support/topic/disabling-pingbackstrackbacks-on-pages/page/2/?output_format=md)

 *  [jasonpaulweber](https://wordpress.org/support/users/jasonpaulweber/)
 * (@jasonpaulweber)
 * [13 years, 2 months ago](https://wordpress.org/support/topic/disabling-pingbackstrackbacks-on-pages/#post-3620249)
 * You can disable comments on pages by going to wp-admin / pages / all pages, and
   clicking **quick edit** (instead of edit). There, you can disable comments for
   the page.
 * Have you gone to wp-admin / settings / discussion … and disabled trackbacks and
   pingbacks there?
 * Or try this plugin … for [eliminating self-trackbacks](http://wordpress.org/extend/plugins/no-self-ping/).
 *  [jasonpaulweber](https://wordpress.org/support/users/jasonpaulweber/)
 * (@jasonpaulweber)
 * [13 years, 2 months ago](https://wordpress.org/support/topic/disabling-pingbackstrackbacks-on-pages/#post-3620254)
 * Or try putting this php file in your mu-plugins or plugins folder:
 *     ```
       <?php
       // Disable X-Pingback HTTP Header.
       add_filter('wp_headers', function($headers, $wp_query){
           if(isset($headers['X-Pingback'])){
               // Drop X-Pingback
               unset($headers['X-Pingback']);
           }
           return $headers;
       }, 11, 2);
       // Disable XMLRPC by hijacking and blocking the option.
       add_filter('pre_option_enable_xmlrpc', function($state){
           return '0'; // return $state; // To leave XMLRPC intact and drop just Pingback
       });
       // Remove rsd_link from filters (<link rel="EditURI" />).
       add_action('wp', function(){
           remove_action('wp_head', 'rsd_link');
       }, 9);
       // Hijack pingback_url for get_bloginfo (<link rel="pingback" />).
       add_filter('bloginfo_url', function($output, $property){
           return ($property == 'pingback_url') ? null : $output;
       }, 11, 2);
       // Just disable pingback.ping functionality while leaving XMLRPC intact?
       add_action('xmlrpc_call', function($method){
           if($method != 'pingback.ping') return;
           wp_die(
               'Pingback functionality is disabled on this Blog.',
               'Pingback Disabled!',
               array('response' => 403)
           );
       });
       ?>
       ```
   
 *  Thread Starter [ghindo](https://wordpress.org/support/users/ghindo/)
 * (@ghindo)
 * [13 years, 2 months ago](https://wordpress.org/support/topic/disabling-pingbackstrackbacks-on-pages/#post-3620258)
 * Thanks for the response!
 * I’ve had trackbacks/pingbacks disabled through wp-admin/settings/discussion for
   a while now, but that seems to only affect **posts**, not **pages**.
 * Disabling comments one-by-one seems a little impractical in my case, especially
   since I also seem to be getting trackbacks on attachment pages, which aren’t 
   accessible through wp-admin/pages/all pages.
 * I might try out that little mini plugin, although I’m averse to adding more plugins
   to my install and would rather use another method.
 * Thanks again for the help!
 *  [jasonpaulweber](https://wordpress.org/support/users/jasonpaulweber/)
 * (@jasonpaulweber)
 * [13 years, 2 months ago](https://wordpress.org/support/topic/disabling-pingbackstrackbacks-on-pages/#post-3620268)
 * I’d be more adverse to altering your core WP or core theme files. You’ll have
   to keep a changelog handy, as everytime you update your WP or theme, you’ll lose
   your changes.
 * Yes, too many plugins can bog things down a bit, but not a mini plugin like this.
   You can always use the [P3 Plugin Profiler](http://wordpress.org/extend/plugins/p3-profiler/)
   to determine which plugins are adding the most to your page load times … Jetpack
   and various types of lightbox plugins being some of the more notable culprits.
 *  Thread Starter [ghindo](https://wordpress.org/support/users/ghindo/)
 * (@ghindo)
 * [13 years, 2 months ago](https://wordpress.org/support/topic/disabling-pingbackstrackbacks-on-pages/#post-3620386)
 * Thanks for the advice, Jason. I’ll try out the plugin and see how it goes.
 *  Thread Starter [ghindo](https://wordpress.org/support/users/ghindo/)
 * (@ghindo)
 * [13 years, 2 months ago](https://wordpress.org/support/topic/disabling-pingbackstrackbacks-on-pages/#post-3620402)
 * Saved the script you posted as a PHP file in the plugins folder and I’m still
   getting a ton of trackback spam, close to or over 1,000 a day. I’m not sure if
   I did something wrong in saving the script, or if it’s just plain not working.
 *  [jasonpaulweber](https://wordpress.org/support/users/jasonpaulweber/)
 * (@jasonpaulweber)
 * [13 years, 2 months ago](https://wordpress.org/support/topic/disabling-pingbackstrackbacks-on-pages/#post-3620404)
 * If you saved it to your plugins folder, you’ll have to activate it. If you save
   it to your MU-Plugins folder (MU = must use, then it will automatically activate.
 * But that script wasn’t personally tested by me. I had a friend who used it. I’ll
   look around for a separate solution.
 *  Thread Starter [ghindo](https://wordpress.org/support/users/ghindo/)
 * (@ghindo)
 * [13 years, 1 month ago](https://wordpress.org/support/topic/disabling-pingbackstrackbacks-on-pages/#post-3620519)
 * Plugin didn’t work for me. Might have been my incompetence in installing it, 
   but I tried it in both the regular plugins directory and the mu-plugins directory.
 * Still getting hundreds of instances of trackback spam every day. Not sure what
   else to do to stop it, other than marking pages of comments as spam every day.
 * Any other help would be greatly appreciated.
 *  Thread Starter [ghindo](https://wordpress.org/support/users/ghindo/)
 * (@ghindo)
 * [13 years ago](https://wordpress.org/support/topic/disabling-pingbackstrackbacks-on-pages/#post-3620528)
 * What would I do to just strip out the commenting/pingback functionality of a 
   page template altogether? Would that solve the issue?
 *  [maryfran](https://wordpress.org/support/users/maryfran/)
 * (@maryfran)
 * [12 years, 11 months ago](https://wordpress.org/support/topic/disabling-pingbackstrackbacks-on-pages/#post-3620541)
 * I thought that there may be a place to add tracbacks to the Quick Edit list on
   pages. I have been getting trash and spam. I will continue to go through all 
   of my pages and turn it off.
 *  [jronder](https://wordpress.org/support/users/villas-diani/)
 * (@villas-diani)
 * [12 years, 5 months ago](https://wordpress.org/support/topic/disabling-pingbackstrackbacks-on-pages/#post-3620567)
 * sunny greetings from Diani beach maryfran, I was also trying to disable it as
   it was rare for me to get a proper ping, all are spam most of the time. I spent
   some time looking up how to disable it. I found a post how to do it easy, but
   I am not sure if it works as I still did not have time to try.
 * Hope it helps,
    July
 *  [jronder](https://wordpress.org/support/users/villas-diani/)
 * (@villas-diani)
 * [12 years, 5 months ago](https://wordpress.org/support/topic/disabling-pingbackstrackbacks-on-pages/#post-3620568)
 * oh, here is the link to that post [](http://www.kensfi.com/how-to-disable-pingbacks-trackbacks-in-5-seconds/)
 *  [garratt](https://wordpress.org/support/users/garratt/)
 * (@garratt)
 * [12 years, 5 months ago](https://wordpress.org/support/topic/disabling-pingbackstrackbacks-on-pages/#post-3620569)
 * Not sure that post is the best suggestion as call to that file will simply cause
   errors, yes it will _fix_ the problem, but only temporarily.
 * I suggest something a little less extreme, and something that won’t be _broken_
   the next time WordPress updates and recreates the file you deleted.
 * [how to disable trackbacks](http://www.wpbeginner.com/wp-tutorials/how-to-disable-trackbacks-and-pings-on-existing-wordpress-posts/)
 * The problem is existing posts/pages don’t get updated when you select to not 
   have trackbacks. The above link will fix that.
 *  [garratt](https://wordpress.org/support/users/garratt/)
 * (@garratt)
 * [12 years, 5 months ago](https://wordpress.org/support/topic/disabling-pingbackstrackbacks-on-pages/#post-3620570)
 * sorry updated my post with a link you can use.
 *  [jronder](https://wordpress.org/support/users/villas-diani/)
 * (@villas-diani)
 * [12 years, 5 months ago](https://wordpress.org/support/topic/disabling-pingbackstrackbacks-on-pages/#post-3620571)
 * I do not know why but it was realy giving me a hard time to paste the link here.
 * The 3rd try, here is the link: [how to disable the trackbacks and ping backs](http://www.kensfi.com/how-to-disable-pingbacks-trackbacks-in-5-seconds/)
 * Once again, I am not sure if it is working. I hope it helps:-)
 * July

Viewing 15 replies - 1 through 15 (of 16 total)

1 [2](https://wordpress.org/support/topic/disabling-pingbackstrackbacks-on-pages/page/2/?output_format=md)
[→](https://wordpress.org/support/topic/disabling-pingbackstrackbacks-on-pages/page/2/?output_format=md)

The topic ‘Disabling Pingbacks/Trackbacks on Pages’ is closed to new replies.

## Tags

 * [pingback](https://wordpress.org/support/topic-tag/pingback/)
 * [trackback](https://wordpress.org/support/topic-tag/trackback/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 16 replies
 * 6 participants
 * Last reply from: [AITpro](https://wordpress.org/support/users/aitpro/)
 * Last activity: [12 years, 2 months ago](https://wordpress.org/support/topic/disabling-pingbackstrackbacks-on-pages/page/2/#post-3620577)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
