Why are apostrophes and other characters still showing as code in my titles?
-
Hi,
I have a WordPress-based site and overall everything is working well. However, I can't seem to figure out how to get apostrophes and other characters to display normally.
Now, the problem isn't that they are displaying as code to normal visitors or up in the title bar, they are displaying as code to Google's bots as well as to SEOMOZ.
Example:
Normal visitor sees:
About **** | **** - Metro Vancouver's IT & Web Experts
Google and SEOMOZ see:
About **** | **** - Metro Vancouver's IT & Web Experts
I've played around with different ways of typing the title (not using character codes vs. using character codes) and nothing seems to work.
Any help or explanation would be appreciated.
-
Gabriel-
It's no problem for these codes to appear in other sections of the page. There are many character sets out there, and what may appear great to you (without codes) looks like gibberish to someone else. The codes help make for a uniform experience for everyone. For instance, there are no "smart quote" keys on your keyboard, yet some programs (like Word) will automatically insert these for you. To have these on a web page most systems will convert these to codes for you. The ampersand, however, falls into this category since it's often an escape character for other characters.
So, the place we're still really most concerned about is the meta title. I'm not sure why the mb_convert_encoding() function didn't work for you?
If you'd like me to take a closer look feel free to message me. This is solvable - I've done it before on WP sites.
-
One more thing - I've noticed that Google, SEOMOZ, and Firefox's View Source all show apostrophes, ampersands, and other characters as code not just in the title tag but also throughout the body of the page - so it is a general problem.
-
I actually removed site caching because it was causing some problems. But yes, I had it on previously.
I'm wondering if the wordpress function - wp_texturize - is doing something funny to the titles...
-
Gabriel-
Do you have some sort of site caching turned on?
-
Fixed some of the other issues with my site (had a bunch of white spaces in my php files) but this is still not working. I inserted your code and it doesn't break anything, but it doesn't work either from what I can tell...
-
Gabriel, I think we're close here... give this a try:
<title></p> <p><?php wp_title('«', true, 'right'); ?></p> <p><?php echo mb_convert_encoding(get_bloginfo('name', 'display'), 'UTF-8', 'HTML-ENTITIES'); ?></p> <p></title>
-
Okay, I found the line:
<title><?php wp_title('«', true, 'right'); ?> <?php bloginfo('name'); ?></title>
And I tried inserting your code multiple ways but now Fetch as Googlebot is saying the site is unreachable. I've reversed but still get same problem...
Strange stuff.
-
Look in your header.php file. Here's what the <title>tag code might look like. Again, you may need to wrap the mb function around more than one piece. This should get you started.</p> <blockquote style="color: #5e5e5e; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: #f7f7f7; padding-top: 5px; margin-left: 0px; padding-left: 2px; padding-bottom: 5px; white-space: nowrap; overflow-y: auto; font-family: monospace; background-position: initial initial; background-repeat: initial initial;"> <p><span style="color: #5e5e5e;"><title><?php</span></p> <p><span style="color: #5e5e5e;"> </span><span style="color: #5e5e5e;">/*</span><span style="color: #5e5e5e;"><span> </span>Print the <title> tag based on what is being viewed.</span><span style="color: #5e5e5e;"><span> </span> */</span></p> <p><span style="color: #5e5e5e;"> </span><span style="color: #5e5e5e;">global $page, $paged;</span><span style="color: #5e5e5e;"><br /></span><span style="color: #5e5e5e;"><span> </span></span></p> <p><span style="color: #5e5e5e;">wp_title( '|', true, 'right' );</span><span style="color: #5e5e5e;"><br /></span><span style="color: #5e5e5e;"><span> </span></span></p> <p><span style="color: #5e5e5e;">// Add the blog name.</span><span style="color: #5e5e5e;"><span> </span>bloginfo( 'name' );</span><span style="color: #5e5e5e;"><br /></span><span style="color: #5e5e5e;"><span> </span></span></p> <p><span style="color: #5e5e5e;">// Add the blog description for the home/front page.</span></p> <p><span style="color: #5e5e5e;">$site_description = mb_convert_encoding(get_bloginfo( 'description', 'display' ), 'UTF-8', 'HTML-ENTITIES');</span><span style="color: #5e5e5e;"><br /></span><span style="color: #5e5e5e;"><span> </span></span></p> <p><span style="color: #5e5e5e;">if ( $site_description && ( is_home() || is_front_page() ) )</span></p> <p><span style="color: #5e5e5e;"><span style="white-space: pre;"> </span>echo " | $site_description";</span><span style="color: #5e5e5e;"><br /></span><span style="color: #5e5e5e;"><span> </span></span></p> <p><span style="color: #5e5e5e;">// Add a page number if necessary:</span></p> <p><span style="color: #5e5e5e;">if ( $paged >= 2 || $page >= 2 )</span></p> <p><span style="color: #5e5e5e;"><span style="white-space: pre;"> </span>echo ' | ' . sprintf( __( 'Page %s', 'oldheidelbergdeli' ), max( $paged, $page ) );</span><span style="color: #5e5e5e;"><br /></span><span style="color: #5e5e5e;"><span> </span></span></p> <p><span style="color: #5e5e5e;">?></title>
-
Thanks for looking into this. Approximately where would I place this code?
-
This worked for me....
$site_description = mb_convert_encoding(get_bloginfo( 'description', 'display' ), 'UTF-8', 'HTML-ENTITIES');
The text is getting encoding in the second half of your meta tag, so if you convert the encoding you should be able to get around this. You may need to apply this to several sections of that depending on what's going on... check the tag out on several pages.
Let me know how it works out.
-
Well what would be the html entity code for a standard apostrophe. And even if that is solved, the & is still not displaying correctly.
I've searched many forums for the answer but nothing seems to be coming up!
-
Hi Gabriel,
' Looks like an html entity code for some non-standard apostrophe. Not sure why though, it looks normal. Your apostrophe might need to be changed to a single quote instead.
-
I've done what you've said and this is what I've come up with:
<title><?php wp_title('«', true, 'right'); ?> <?php bloginfo('name'); ?></title>
Does anything look odd?
-
Ahh, you are right about the first ampersand. You should probably take a look at the wp_title() function and see if it's doing any html_special_chars filtering. Again, if nothing else seems to work, you could change up the "and" remove the possessive on Vancouver.
-
Thanks for the quick reply. I tried doing that but not luck. The odd thing is that using Google's Webmaster tools, I see that the meta title and some of the headings have the code in them whereas other body text doesn't. Either way, I need to resolve this.
I tested a page and here are a couple of lines:
<code><title>IT & Web Services | **** - Metro Vancouver's IT & Web Experts</title> Odd how the first & (and) looks fine whereas the second doesn't.</code>
-
Hey Gabriel-
Quick and dirty... you could change the meta title to Function 5 - Metro Vancouver IT and Web Experts.
Have you tried putting the full & in the meta title? There might be a double-conversion issue going on there.
-John
Got a burning SEO question?
Subscribe to Moz Pro to gain full access to Q&A, answer questions, and ask your own.
Browse Questions
Explore more categories
-
Moz Tools
Chat with the community about the Moz tools.
-
SEO Tactics
Discuss the SEO process with fellow marketers
-
Community
Discuss industry events, jobs, and news!
-
Digital Marketing
Chat about tactics outside of SEO
-
Research & Trends
Dive into research and trends in the search industry.
-
Support
Connect on product support and feature requests.
Related Questions
-
Appending a code at the end of a URL
Hi All, Some real estate/ news companies have a code appended to the end of a URL https://www.realestate.com.au/property-house-qld-ormiston-141747584 https://www.brisbanetimes.com.au/national/queensland/childcare-centre-could-face-prosecution-for-leaving-child-on-hot-bus-20230320-p5ctqs.html Can I ask if there's any negative SEO implications for doing this? Cheers Dave
Technical SEO | | Redooo0 -
Google Serps Not Showing HTTPS in Front of URL
Hi Everyone, We implemented the HTTPS change to our four websites about 6 months ago. I have found something that I feel is strange. The homepage of each website shows www.domain.com, but all the internal pages show https://www.domain.com/page. If you click through it shows it as secure, but I feel that because it is happening on all four websites, that something was done incorrectly. Here is one Google SERP: https://www.google.com/search?client=firefox-b-1&biw=1920&bih=947&ei=gq9GWpizBuuF_Qa_p5e4Bw&q=tanzanite+jewelry+designs&oq=tanzanite+jewelry+designs&gs_l=psy-ab.3..0l2.130446.136028.0.136152.29.17.4.7.9.0.207.2214.7j9j1.17.0....0...1c.1.64.psy-ab..1.28.2350...0i131k1j0i22i30k1.0.BA5-meGmuA0 As you can see, our site displays with no https, but all the internal pages do. It just worries me as I have seen our internal pages increasing in positioning, but not our homepage. Any ideas?
Technical SEO | | vetofunk0 -
URL Change, Old URLs Still In Index
Recently changed URLs on a website to remove dynamic parameters. We 301'd the old dynamic links (canonical version) to the cleaner parameter-free URLs. We then updated the canonical tags to reflect these changes. All pages dropped at least a few ranking positions and now Moz shows both the new page ranking slightly lower in results pages and the old page still in the index. I feel like I'm splitting value between the two page versions until the old one disappears... is there a way to consolidate this quickly?
Technical SEO | | ShawnW0 -
Issue with Title of Homepage - Wordpress Platform
I can't seem to get Google to read the title of my homepage the way I would like it to be read and I have double checked in all areas of my Wordpress Platform where the title may be defaulting and all it set up correctly. I have also ensured that the "force re-write of titles and meta descriptions" have been checked through a plugin I am using to monitor SEO (Yoast)... here is an example of how Google is reading my homepage title: XYZ Company: Primary Keyword in Ontario Canada - XYZ Company I would like it to read: Primary Keyword in Ontario Canada - XYZ Company But for some reason it keeps pulling in my website title. I have always re-submitted my URL to Google but no luck with the title change. If anyone has any insight as to why this is defaulting as such I would greatly appreciate it. Thanks!
Technical SEO | | MainstreamMktg0 -
Changing all titles
A new client of mine has a terrible Wordpress site with many issues and one of these is keyword stuffing, especially in the title. We all know how bad it is, but then what's the best way to remove the keywords in excess? They stuffed 4 keywords (average 3 terms per keyword) in the wordpress General Settings "Site Title", so all of them are included in the title, and there are 200 pages basically with the same, stuffed, title. I am pretty sure if I remove them, and put a unique keyword per page I would have a huge rank drop, but is there any way to minimize it? 2nd question: should I improove the on-page factors and wait for the rank drop/resume before starting a linkbuilding campaign? Thank you. DoMiSol
Technical SEO | | DoMiSoL0 -
Duplicate titles Question
Hi eveyone, I have around 1000 duplicate titles and meta description. The poblem was that I had pages in my home page and different pages had the same title. For example, index.php/site/articles/should_you_eat_protein_every_2-3_hours_for_muscle_growth/ /index.php/site/articles/should_you_eat_protein_every_2-3_hours_for_muscle_growth/N12//index.php/site/articles/should_you_eat_protein_every_2-3_hours_for_muscle_growth/N1444//index.php/site/articles/should_you_eat_protein_every_2-3_hours_for_muscle_growth/N1448//index.php/site/articles/should_you_eat_protein_every_2-3_hours_for_muscle_growth/N1448/P6//index.php/site/articles/should_you_eat_protein_every_2-3_hours_for_muscle_growth/N1452/I have 172 of the same page!So I took off all the pagination on my home page and just added 'click fo more'. When they click more, it takes them to the category.So my question is will google slowly start deleting or non-indexing these duplicate titles or pages as I have removed it from my website? (Just so that you know I added a canonical link and figuring out how to add page numbers to met titles and meta description tags for categories with pages)
Technical SEO | | anoopbal0 -
Duplicate Page Content and Titles
A few weeks ago my error count went up for Duplicate Page Content and Titles. 4 errors in all. A week later the errors were gone... But now they are back. I made changes to the Webconfig over a month ago but nothing since. SEOmoz is telling me the duplicate content is this http://www.antiquebanknotes.com/ and http://www.antiquebanknotes.com Thanks for any advise! This is the relevant web.config. <rewrite><rules><rule name="CanonicalHostNameRule1"><match url="(.*)"><conditions><add input="{HTTP_HOST}" pattern="^www.antiquebanknotes.com$" negate="true"></add></conditions>
Technical SEO | | Banknotes
<action type="Redirect" url="<a href=" http:="" www.antiquebanknotes.com="" {r:1"="">http://www.antiquebanknotes.com/{R:1}" />
</action></match></rule>
<rule name="Default Page" enabled="true" stopprocessing="true"><match url="^default.aspx$"><conditions logicalgrouping="MatchAll"><add input="{REQUEST_METHOD}" pattern="GET"></add></conditions>
<action type="Redirect" url="/"></action></match></rule></rules></rewrite>0 -
Why are old versions of images still showing for my site in Google Image Search?
I have a number of images on my website with a watermark. We changed the watermark (on all of our images) in May, but when I search for my site getmecooking in Google Image Search, it still shows the old watermark (the old one is grey, the new one is orange). Is Google not updating the images its search results because they are cached in Google? Or because it is ignoring my images, having downloaded them once? Should we be giving our images a version number (at the end of the file name)? Our website cache is set to 7 days, so that's not the issue. Thanks.
Technical SEO | | Techboy0