Double title since v.1.4.7
-
Hi! I updated my theme to version 1.4.7 from 1.4.5 and I noticed that I have two title tags in source code and they look like this;
<title>abc &# 8211; website</title>
<title>abc | website</title>Is this normal or?
-
Hi dararede. Doesn’t look quite right. Can you post a link to your site? Thanks.
Make sure to update to WordPress 4.1+
I am using latest WP, here is the website; http://www.kartoslo.com
When I activate 1.4.5 I have one title and with 1.4.7 I have two.
Same problem here and it affects when you use OpenGraph and Twitter cards links apears like this:
og:title El secreto de los hongos rojos de Mario Bros.diipad | diipad
There is 2 “diipad” titles :/
@dararede – Which title specifically are you referring to? The site title? Page title? Are you currently running v1.4.7? If not, please activate it so we can see the issue. Thanks.
Please see my source, there you will find two(four in total) < title > tags.
OK, I see it now. One contains a “-” separator and the other a “|”. It’s the same in v2.2.0. I’ll do some checking and see what I can find.
After some research here’s what I’ve come up with. The title with the “-” separator is generated by code in the theme header.php file. That’s the way the theme was originally designed. The title with the “|” is generated automatically by WP if the theme provides support for the standardized WP title. This standardized title was added to WP in v4.1. The latest versions of the theme included support for the standardized WP title, so we end up with two title tags. Since the WP title is inserted after the theme title, the theme title is used and the WP title is ignored. Having two title tags does not appear to generate any conflicts within the theme. My guess is the theme title was left in to provide backward compatibility until more users move to WP 4.1+. If you are having problems with plugins or other functionality, one workaround is to copy header.php to a child theme and remove the built-in <title> tag line.
Alex – if you’re reading this, and I’ve missed something, please feel free to correct what I’ve posted. Thanks.I’m not an expert, but having two title tags is not the best for SEO. Removing title code from header.php is one way of resolving this problem but it doesn’t see right to me.
My theme setups works fine, so it should be one of the following:
1. You have a child theme that does not use the updated header.php
<title><?php wp_title( '-', true, 'right' ); ?></title>2. You have the alx_setup function in your child theme, which needs to be updated with:
// Enable title tag add_theme_support( 'title-tag' ); Refer to the parent theme to see how they are added.3. You use some SEO plugin which modifies the title in some way and conflicts.
4. You need to upgrade to WordPress 4.1+I have checked two of my websites, both have double titles, now I installed fresh WP 4.1, no plugins, downloaded theme from admin panel and again I have double titles.
Hm, looks like it’s my mistake then. Must’ve applied the new title tag wrong. Let me look into it.
Edit: Yeah, there should be no <title> in header.php at all. My mistake.
Edit 2: Update submitted. Thanks for reporting the issue!
The topic ‘Double title since v.1.4.7’ is closed to new replies.
