Manipulating wp_head content

Information attached to the wp_head action hook is echoed (if it needs to be echoed) as it occurs. There is no “wp_head” content string that you can search and replace.

  1. You will need to find the callback functions/methods for the data
    you are interested in manipulating and hope that there hooks built
    in that will help you out.
  2. Or remove those callbacks and add your own to replace them
  3. Or try output buffering around wp_head:

    ob_start();     
    wp_head(); 
    $head = ob_get_contents();
    ob_end_clean();
    echo $head;
    

Leave a Comment