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.

This is more of a conceptual question, but it has actual ramifications.

Going through the various SEO plugins I found nowhere a PHP tag that should be embedded in the actual HTML page and echo the meta data. How does it work then?

Simply saving it to the DB doesn't seem enough. What is the mechanism through which the plugin "injects" the SEO data to the page?

share|improve this question
    
Wiki style: {CITATION NEEDED} –  brasofilo Jan 5 '13 at 11:05
add comment

1 Answer

up vote 1 down vote accepted

In case you are talking about adding meta tags and changing the title they rely on wp_head action being fired at theme header before the </head>tag is generated.

For changing the title they probably use the wp_title filter. Older versions of "all in one seo" used to buffer the head section and replace the title tag in something like

add_action('init','start_buf');
function start_buf( {
  ob_start();
}

add_action('wp_head','end_buf');
function end_buf() {
  $head = ob_get_contents();
  $head = string replace '<title>....</title>' in $head with the configured title
  ob_end_clean();
  echo $head;
}
share|improve this answer
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.