While the title isn't a meta tag, it's quite possible to create a meta title tag. There's generally much confusion of the two, som SEO people talking about 'meta title' when they in fact mean the title tag, and no-one seems to be able to prove any advantages to using meta title.

However, it can be put to good use nevertheless. Attached patch defines the title meta tag, and provides a new formatter for meta tags that sets the page title. Apart from allowing those wanting the title meta tag to use it, it can be used to make meta title act as an override for the title. This means moving in on page_title territory, but metatags_quick have the advantage of also working on non-node pages. It also makes sense as meta tags is the focus of SEO folks, and the other big SEO thing is ensuring the proper title, which isn't always best title for the node.

Also worth noting that it seems that the metatag module supports a 'meta title' element by setting the page title.

The patch from comment #4 above works great, except that it also changes the h1 title printed on the page. I'm looking for a solution that allows me to have a completely different title in the <title> tag and also allows me to override the default pattern (ie. including the "| sitename" part).

The attached patch builds upon the one from comment #4. Basically when the display formatter is set to "default metatags_quick formatter" and the meta tag field is the title, it sets the "title" tag in addition to the meta tag of type "title". This allows me to have a different page title from the one in the h1 tag, and also allows me to remove the "| sitename" or change it in whatever way I wish.

#7: thanks for a great amount of work. While the patch looks ok from the first sight, I would like to hear some responses if we need such a functionality inside metatags_quick (and not page_title, for example)

Found an odd bug in this. The patch in #7 doesn't work unless the page_title module is present and enabled.

If I turn off the page_title module, the functionality added by #7 above stops working. I'm using the metatag module suite and had page_title enabled as well as metatags_quick. I'm completely dropping page_title from the mix as it's no longer wanted/needed.

My use case was that the metatags modules left a hole with adding tags to Views pages. My customer has no access to the Views admin area so it wasn't possible to allow them to update their own tags on Views pages using the metatag module suite. metatags_quick, along with Stella's patch above filled that gap.

Here's a patch that removes the (unexpected) page_title module dependency.

John CarboneCreditAttribution: John Carbone commented October 1, 2013 at 3:21pm

Agreed, it's a head scratcher. With regard to the possibility of some other code getting in the way, I don't have any custom code running that calls drupal_set_title directly although I do have something that runs drupal_get_title (which calls drupal_set_title with no parameters to get it).

Anyway, the original patch in #7 includes code that wasn't getting run in my testing. As far as I can tell, this was a simple oversight. The code below (from #7) was never getting hit because the patch was calling drupal_set_title directly, rather than using _metatags_quick_add_head (where the code below was added in #7). _metatags_quick_add_head does some cleanup on existing tags in the head and eventually calls drupal_add_html_head by default which "Adds output to the HEAD tag of the HTML page." Since the intent here is not to change the title of the page itself but rather to change the page title in the head of the document, this all seems logical to me, but maybe I'm missing something.

This removes stellas addition and adds an option to the "Set page title" formatter to select the method used. There's the drupal_set_title method which can be used by those that prefer the meta title to override the node title on node view, and there's the preprocess_html for those that just want to set the title element in the head.