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
Elegant Themes
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 »

Comments

  1. Dave says:

    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?

  2. Frank J says:

    Why not just use Bulk Edit in WordPress?

  3. Chris M Cloutier says:

    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

  4. Dave says:

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

  5. Kapil says:

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

  6. Eric Buist says:

    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).

  7. Huguens M. says:

    You guys are awesome! Thank you for this.

  8. Jess says:

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

  9. Kartik Jain says:

    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 says:

      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!!

  10. Jon Hibbitt says:

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

  11. Manuel says:

    Thanks nice article and useful!!!

  12. John Dunne says:

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

  13. Chris says:

    Run via WordPress database manager, work like a charm.

  14. Kenny says:

    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.

  15. Tyler says:

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

  16. Adrian says:

    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.

  17. Francois Guibert says:

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

  18. matt spitsbergen says:

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

    • Editorial Staff says:

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

  19. DiviningMind says:

    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

    • wpbeginner says:

       @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.

  20. Livefyre says:

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

  21. bryandzscuj5 says:

    @reycalantaol http://t.co/JMHsacy

  22. ReyCalantaol says:

    @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 says:

      @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

  23. wpbeginner says:

    @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…

  24. ReyCalantaol says:

    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.

  25. wpbeginner says:

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

  26. roraz says:

    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!

  27. btfb says:

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

Add a Comment

We're glad you have chosen to leave a comment. Please keep in mind that all comments are moderated according to our comment policy, and all links are nofollow. Do NOT use keywords in the name field. Let's have a personal and meaningful conversation.