Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I have a plugin that generates a meta description or title as two of its features. However I run into the problem of other SEO plugins possibly being installed, and ending up with two meta descriptions or duplicate titles.

Ideally, I'd like to detect what is already in the <head> section and if a meta description is present, re-write it with the output from my plugin. If no meta description is present, then I simply add one (that's the easy part). Same situation for titles.

Trouble is I can't seem to find any way to get the contents of <head>, as one can with the_content in a filter or action hook. It's not an option to edit the theme as this must work regardless of the installed theme. I need a way to accomplish this using a hook or some other method from within my plugin itself.

Suggestions? Thanks!

share|improve this question
add comment

1 Answer 1

Use, wp_head http://codex.wordpress.org/Plugin_API/Action_Reference/wp_head

Ref example: Wordpress wp_head() crap

share|improve this answer
    
To expound on that a bit: you can find out what functions other Plugins hook into wp_head, and then make your own code conditional on if ( ! function_exists( 'other_plugin_wp_head_hook_function' ) ). –  Chip Bennett Jul 17 '11 at 19:57
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.