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

How to Disable Trackbacks and Pings on Existing WordPress Posts

Last updated on by
Special WordPress Hosting offer for WPBeginner Readers
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 experts 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 »


  1. Vitaliy says:

    This may sound super weird, but I actually need something to the opposite effect. I need to know what other pages of my site link back to a particular page within my site (so that I know if I need to redirect the URL if I decide to delete that particular page).

    It would be just awesome if you could suggest a WP plugin to that effect but I’m not really sure that it exists because I tried to find one and for the life of me I had virtually no luck! :)

    In the worst case scenario, I’m ready to implement a code-involving solution, but that’s not really preferable.

  2. Goran says:

    Do this actually STOP’s the spammers to link to your site with trackbacks or?

    As i see a lot of sites are linking to the specific posts/pages with the same anchor text and that would be the post/page title.

    Will it hurt rankings?


    • WPBeginner Support says:

      It will stop trackbacks from appearing on your site. However, people can still link to your posts on their sites.

  3. Nijanthan Vijayakumar says:

    I am receiving lots os spam trackbacks from other sites. I think this will work for me. I have multiple domains installed on the same server. I selected the required database and ran the query. There were no errors. Let me see if this works. Thanks in advance.

  4. Judah says:

    Can’t seem to get this to work…

    I keep getting the following result: # MySQL returned an empty result set (i.e. zero rows).

    Any ideas?

  5. 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?

  6. Frank J says:

    Why not just use Bulk Edit in WordPress?

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

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

  9. Kapil says:

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

  10. Eric Buist says:

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

  11. Huguens M. says:

    You guys are awesome! Thank you for this.

  12. Jess says:

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

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

  14. Jon Hibbitt says:

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

  15. Manuel says:

    Thanks nice article and useful!!!

  16. John Dunne says:

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

  17. Chris says:

    Run via WordPress database manager, work like a charm.

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

  19. Tyler says:

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

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

  21. Francois Guibert says:

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

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

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

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

  25. bryandzscuj5 says:


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

  27. 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…

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

  29. wpbeginner says:

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

  30. roraz says:

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

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