Beginner's Guide for WordPress - Start your WordPress Blog in minutes.
Choosing the Best
WordPress Hosting
How to Easily
Install WordPress
Recommended
WordPress Plugins
View all Guides

How to Disable Trackbacks and Pings on Existing WordPress Posts

Last updated on by
Follow WPBeginner on YouTube
How to Disable Trackbacks and Pings on Existing WordPress Posts

WordPress has the ability to receive and send pings/trackbacks from and to other sites. At WPBeginner we receive hundreds of spam trackbacks daily. In the past due to our theme structure, we had the trackbacks hidden however now when using livefyre we ran into the problem of having trackbacks and pings showing below our posts. First thing we did was disabled trackbacks and pings from the Settings » Discussions page. However that does not change the status on existing posts. In this article, we will show you how to disable trackbacks on existing WordPress posts.

This tutorial requires you to run a MySQL query, so we highly recommend that you backup your database before executing the query.

First, you need to login to phpMyAdmin and locate your WordPress database. (Below is a screenshot of a HostGator cPanel)

Login to phpMyAdmin in HostGator

You need to click on the SQL tab:

SQL tab in phpMyAdmin

And execute the following query:

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';

And you are done :) Now all of your existing published WordPress posts will have trackbacks disabled as well.


Editorial Staff at WPBeginner is a team of WordPress lovers led by Syed Balkhi. Page maintained by Syed Balkhi.

WPBeginner's Video Icon
Our HD-Quality tutorial videos for WordPress Beginners will teach you how to use WordPress to create and manage your own website in about an hour. Get started now »
  • Dave

    After running the query I have two post_type = “nav_menu_item” that are still open. I suppose time will tell if this is a vulnerability and if I should update them as well. Any thoughts?

  • Frank J

    Why not just use Bulk Edit in WordPress?

  • Chris M Cloutier

    Thanks, this seems to have worked perfectly on my blog. I couldn’t figure out why I was pinging myself when all I wanted to do was link to related posts. I ran this SQL and, bada bing! No more pings. Hey that kinda rhymed. Thanks again

  • Dave

    I also needed to do this for revised posts. As the post_type changed to ‘revision’ – I also used the following:

    UPDATE wp_posts SET ping_status=’closed’ WHERE post_status = ‘publish’ AND post_type = ‘revision';

  • Kapil

    If We will change the default value ‘open’ to ‘closed’ than I think pingbacks will never appear on blog. Am i right ?

  • Eric Buist

    Hi,
    I really hate to copy/paste obscure stuff from Web pages to web pages, because I have no reliable way to figure out if I missed some part or not and sometimes, the stuff on the source web page has errors that cannot be detected without a deep understanding of the thing you are doing. Moreover, since I installed my blog using Softaculous, I have no clue about the password needed to get access to its internal DB. Is there any plugin that could do this change rather than relying on a backdoor? Or a way to restrict trackbacks to registered users (that would at least prevent trackbacks for old and new posts).

  • Huguens M.

    You guys are awesome! Thank you for this.

  • Jess

    I’m always wary about executing database queries, but this was really simple. Thanks!

  • Kartik Jain

    Please Mention one more thing with this post..
    Some developer changes the default wordpress database prefix due to security reason…
    so this query will not work

    we have to change the wp_post to the desired name in the database…

    • Jackson Davies

      Thanks Kartik, this was the missing element that was preventing the SQL working. My wp_post field had a different initial prefix as you suggested and if the host is security conscious they normally change anything WP to something else in case someone tries to do some damage.

      Thanks for this guide WPBeginner. These annoying trackback spams were starting to drive me crazy!!

  • Jon Hibbitt

    Thanks for this – what an annoyance one checkbox in WordPress Admin causes. Bye-bye spam :)

  • Manuel

    Thanks nice article and useful!!!

  • John Dunne

    Thanks for this, they were beginning to drive me nuts.

  • Chris

    Run via WordPress database manager, work like a charm.

  • Kenny

    The other post explaining Trackbacks and Pingbacks is the first explanation I have read that allowed me to really understand the situation.

    This post allowed me to easily clear old trackbacks and pings despite having no SQL background – being able to copy the code out of the post is great.

    Finally, I installed No Self Pings plugins on my sites so that should have got rid of that annoyance.

    Great work guys.

  • Tyler

    Thanks for this helpful post. I’m quite relieved not to have to worry about the trackbacks filling up my comments anymore.

  • Adrian

    Thanks for the clear explanation of what a trackback or ping back is, and why they are unhelpful. I should have read this before enabling them on our Kanda blog, as they have been getting worse over time.

    Luckily your explanation of how to disable them on existing posts was equally good, thanks again.

  • http://twitter.com/Frozax Francois Guibert

    Thanks a lot. I didn’t understand at first why I still received trackbacks even though I disabled it.

  • matt spitsbergen

    I tried running this, and it appeared to be successful. However, I still see the pingbacks showing on the blog.

    • http://www.wpbeginner.com Editorial Staff

      This does not delete existing trackbacks. It just disables future ones on existing posts.

  • DiviningMind

    It doesn’t work, get a message:
    #1064 – You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ‘2    UPDATE wp_posts SET ping_status=’closed’ WHERE post_status = ‘publish’ AND pos’ at line 1

    • http://www.wpbeginner.com/ wpbeginner

       @DiviningMind It seems like that your code was cut off? Please make sure that there is no extra space / returns in the code. Not sure if it was the error that cut the code off, or you didn’t have the last post_type bit.
       
      Also you have to adjust the tables name accordingly. If you are not using the default wp_ structure, then you should adjust for that.

  • Livefyre

    @Rigger82 Thanks for the heads up and your feedback Chris. We’ll pass this to our dev team for investigation and keep you updated.

  • bryandzscuj5

    @reycalantaol http://t.co/JMHsacy

  • http://reygcalantaol.com/ ReyCalantaol

    @wpbeginner Ok I understand with that. I just confuse how the spammers get a traffic from the trackback? I mean what do the trackbacks do to give them more traffic?

    • blair biegler

      @how to remove skin tagsI am so excited that I have found this your post because I have been searching for some information about it almost three hours. You helped me a lot indeed and reading this your article I have found many new and useful information about this subject

  • wpbeginner

    @ReyCalantaol Trackbacks cause a lot of SPAM…. As your site gets popular, you will notice people will just copy your content and then send a trackback to your site, so they can get traffic to content that they plagirized from your site…

  • http://reygcalantaol.com/ ReyCalantaol

    What is the advantage of disabling trackbacks and pings from the post? I read some tutorials and they said that it can help your site gain more traffic but I still don’t know how.

  • wpbeginner

    @roraz We use no self ping plugin as well. But that only disables your own site from sending ping not other sites…

  • roraz

    I used http://wordpress.org/extend/plugins/no-self-ping/ to achieve this, though I guess this would be handy if you didn’t want too many plugins running in the background of your site!

  • btfb

    Thanks for the explanation about removing track backs. The tutorial in explained in lucid way.