WordPress.org

Support

Support » How-To and Troubleshooting » Can I make source search/replaces before output?

Can I make source search/replaces before output?

  • I found this function which can replace text inside the content of your article before posting:

    function replace_content($content)
    {
    $content = str_replace('Company Name', '<span class="company">Company Name</span>',$content);
    return $content;
    }
    add_filter('the_content','replace_content');

    Is there anyway to search and replace text in the entire source code? I’d ideally like to make some changes to some url’s in href parameters before outputting to the browser.

    Thanks!

  • The topic ‘Can I make source search/replaces before output?’ is closed to new replies.