Support » Plugins » How can I modify core WordPress actions?

  • I know I can remove core WordPress actions via remove_action, but is there a way to modify a core action to perhaps, change it’s output? For example, the following action is applied by WordPress via add_action('wp_head', 'noindex', 1);:


    function noindex() {
    // If the blog is not public, tell robots to go away.
    if ( '0' == get_option('blog_public') )
    echo "<meta name='robots' content='noindex,nofollow' />\n";
    }

    Is there a way to modify the echo line in the above function?

Viewing 1 replies (of 1 total)
  • Copy the function to your own place and give it a new name, like my_noindex. Then modify it as you like, remove the old action and add your new action.

Viewing 1 replies (of 1 total)
  • The topic ‘How can I modify core WordPress actions?’ is closed to new replies.