WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] How to remove X-Pingback: http://www.example.com/xmlrpc.php (3 posts)

  1. chrishajer
    Member
    Posted 4 years ago #

    Checking the response headers for my website shows this header:

    X-Pingback: http://www.example.com/xmlrpc.php

    I can't figure out where it's coming from. There is no line in my theme <?php bloginfo('pingback_url'); ?>. It's not hard-coded in my theme's header.php. I have the XML-RPC setting unchecked in Settings > Writing, and verified that the enable_xmlrpc option is zet to 0 in the wp_options table.

    I am using WP-Super Cache and I do notice that in the cache meta files I see this header along with the other headers. I suspect that's just because the header is being sent and would be sent even if WP-Super Cache were turned off.

    Any ideas where this could be coming from? I'd like to remove it since I don't use it for anything.

    Thank you.

  2. codestyling
    Member
    Posted 4 years ago #

    Just place this filter into your themes functions.php an it gets removed:

    function remove_x_pingback($headers) {
        unset($headers['X-Pingback']);
        return $headers;
    }
    add_filter('wp_headers', 'remove_x_pingback');
  3. chrishajer
    Member
    Posted 4 years ago #

    Thank you very much for that, it works perfectly. I don't know where the header is coming from, but this certainly removes it.

    Thank you.

Topic Closed

This topic has been closed to new replies.

About this Topic