The purpose of the wp_head code in WordPress

wordpress-3It has been asked by many as to the purpose of the code that is added to the header of many modern WordPress themes. This code is to reside just above the of the header. There is very little detail in the reference to this this code online only it’s usage and placement within WordPress. I recently encountered a theme that contained duplicate entries of this code that made me realize it’s purpose. It serves two purposes.

The purpose of the code is two fold:

Three lines of code are appended to the header.

<link rel="EditURI" type="application/rsd+xml" title="RSD" href="http://blognamehere/xmlrpc.php?rsd" />
<link rel="wlwmanifest" type="application/wlwmanifest+xml" href="http://blognamehere/wp-includes/wlwmanifest.xml" /> 
<meta name="generator" content="WordPress 2.7" />

It appears to be a marker for WordPress plugins that make use of this code; plugins such as NextGEN, Ultimate Google Analytics, WP-DownloadManager, WP Lightbox 2, are to name a few.

I was able to figure this out by disabling all plugins, then enabling them to determine the cause of my duplicate entries for each plugin. As it turned out, there were two entries for . Each plugin found each instance of that code and appended it’s own code there.

This makes way for yet another modification to the header. The use of may once have been needed in the header, however, since automatically appends this code, there is no need for that reference either.