undefined
Skip to content
Moz logo Menu open Menu close
  • Products
    • Moz Pro
    • Moz Pro Home
    • Moz Local
    • Moz Local Home
    • STAT
    • Moz API
    • Moz API Home
    • Compare SEO Products
    • Moz Data
  • Free SEO Tools
    • Domain Analysis
    • Keyword Explorer
    • Link Explorer
    • Competitive Research
    • MozBar
    • More Free SEO Tools
  • Learn SEO
    • Beginner's Guide to SEO
    • SEO Learning Center
    • Moz Academy
    • SEO Q&A
    • Webinars, Whitepapers, & Guides
  • Blog
  • Why Moz
    • Agency Solutions
    • Enterprise Solutions
    • Small Business Solutions
    • Case Studies
    • The Moz Story
    • New Releases
  • Log in
  • Log out
  • Products
    • Moz Pro

      Your all-in-one suite of SEO essentials.

    • Moz Local

      Raise your local SEO visibility with complete local SEO management.

    • STAT

      SERP tracking and analytics for enterprise SEO experts.

    • Moz API

      Power your SEO with our index of over 44 trillion links.

    • Compare SEO Products

      See which Moz SEO solution best meets your business needs.

    • Moz Data

      Power your SEO strategy & AI models with custom data solutions.

    NEW Keyword Suggestions by Topic
    Moz Pro

    NEW Keyword Suggestions by Topic

    Learn more
  • Free SEO Tools
    • Domain Analysis

      Get top competitive SEO metrics like DA, top pages and more.

    • Keyword Explorer

      Find traffic-driving keywords with our 1.25 billion+ keyword index.

    • Link Explorer

      Explore over 40 trillion links for powerful backlink data.

    • Competitive Research

      Uncover valuable insights on your organic search competitors.

    • MozBar

      See top SEO metrics for free as you browse the web.

    • More Free SEO Tools

      Explore all the free SEO tools Moz has to offer.

    NEW Keyword Suggestions by Topic
    Moz Pro

    NEW Keyword Suggestions by Topic

    Learn more
  • Learn SEO
    • Beginner's Guide to SEO

      The #1 most popular introduction to SEO, trusted by millions.

    • SEO Learning Center

      Broaden your knowledge with SEO resources for all skill levels.

    • On-Demand Webinars

      Learn modern SEO best practices from industry experts.

    • How-To Guides

      Step-by-step guides to search success from the authority on SEO.

    • Moz Academy

      Upskill and get certified with on-demand courses & certifications.

    • MozCon

      Save on Early Bird tickets and join us in London or New York City

    Unlock flexible pricing & new endpoints
    Moz API

    Unlock flexible pricing & new endpoints

    Find your plan
  • Blog
  • Why Moz
    • Small Business Solutions

      Uncover insights to make smarter marketing decisions in less time.

    • Agency Solutions

      Earn & keep valuable clients with unparalleled data & insights.

    • Enterprise Solutions

      Gain a competitive edge in the ever-changing world of search.

    • The Moz Story

      Moz was the first & remains the most trusted SEO company.

    • Case Studies

      Explore how Moz drives ROI with a proven track record of success.

    • New Releases

      Get the scoop on the latest and greatest from Moz.

    Surface actionable competitive intel
    New Feature

    Surface actionable competitive intel

    Learn More
  • Log in
    • Moz Pro
    • Moz Local
    • Moz Local Dashboard
    • Moz API
    • Moz API Dashboard
    • Moz Academy
  • Avatar
    • Moz Home
    • Notifications
    • Account & Billing
    • Manage Users
    • Community Profile
    • My Q&A
    • My Videos
    • Log Out

The Moz Q&A Forum

  • Forum
  • Questions
  • Users
  • Ask the Community

Welcome to the Q&A Forum

Browse the forum for helpful insights and fresh discussions about all things SEO.

  1. Home
  2. SEO Tactics
  3. Technical SEO
  4. Why are apostrophes and other characters still showing as code in my titles?

Moz Q&A is closed.

After more than 13 years, and tens of thousands of questions, Moz Q&A closed on 12th December 2024. Whilst we’re not completely removing the content - many posts will still be possible to view - we have locked both new posts and new replies. More details here.

Why are apostrophes and other characters still showing as code in my titles?

Technical SEO
3
17
13.8k
Loading More Posts
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as question
Log in to reply
This topic has been deleted. Only users with question management privileges can see it.
  • Function5
    Function5 last edited by Jun 15, 2011, 4:30 PM

    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.

    1 Reply Last reply Reply Quote 0
    • blu42media
      blu42media @Function5 last edited by Jun 16, 2011, 11:16 AM Jun 16, 2011, 11:16 AM

      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.

      1 Reply Last reply Reply Quote 0
      • Function5
        Function5 @Function5 last edited by Jun 16, 2011, 7:31 AM Jun 16, 2011, 7:31 AM

        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.

        1 Reply Last reply Reply Quote 0
        • Function5
          Function5 @Function5 last edited by Jun 16, 2011, 7:24 AM Jun 16, 2011, 7:23 AM

          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...

          1 Reply Last reply Reply Quote 0
          • blu42media
            blu42media @Function5 last edited by Jun 16, 2011, 7:05 AM Jun 16, 2011, 7:05 AM

            Gabriel-

            Do you have some sort of site caching turned on?

            1 Reply Last reply Reply Quote 0
            • Function5
              Function5 @Function5 last edited by Jun 16, 2011, 7:00 AM Jun 16, 2011, 7:00 AM

              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...

              1 Reply Last reply Reply Quote 0
              • blu42media
                blu42media @Function5 last edited by Jun 16, 2011, 12:37 AM Jun 16, 2011, 12:37 AM

                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>

                1 Reply Last reply Reply Quote 0
                • Function5
                  Function5 @Function5 last edited by Jun 15, 2011, 7:54 PM Jun 15, 2011, 7:54 PM

                  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.

                  1 Reply Last reply Reply Quote 0
                  • blu42media
                    blu42media @Function5 last edited by Jun 15, 2011, 7:36 PM Jun 15, 2011, 7:36 PM

                    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>

                    1 Reply Last reply Reply Quote 0
                    • Function5
                      Function5 @Function5 last edited by Jun 15, 2011, 7:27 PM Jun 15, 2011, 7:27 PM

                      Thanks for looking into this. Approximately where would I place this code?

                      1 Reply Last reply Reply Quote 0
                      • blu42media
                        blu42media @Function5 last edited by Jun 15, 2011, 7:23 PM Jun 15, 2011, 7:23 PM

                        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.

                        1 Reply Last reply Reply Quote 0
                        • Function5
                          Function5 @networkelites last edited by Jun 15, 2011, 7:08 PM Jun 15, 2011, 7:08 PM

                          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!

                          1 Reply Last reply Reply Quote -1
                          • networkelites
                            networkelites last edited by Jun 15, 2011, 6:54 PM Jun 15, 2011, 6:54 PM

                            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.

                            Function5 1 Reply Last reply Jun 15, 2011, 7:08 PM Reply Quote 0
                            • Function5
                              Function5 @Function5 last edited by Jun 15, 2011, 6:24 PM Jun 15, 2011, 6:16 PM

                              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?

                              1 Reply Last reply Reply Quote 0
                              • blu42media
                                blu42media @Function5 last edited by Jun 15, 2011, 6:10 PM Jun 15, 2011, 6:10 PM

                                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.

                                1 Reply Last reply Reply Quote 0
                                • Function5
                                  Function5 @blu42media last edited by Feb 23, 2012, 6:43 AM Jun 15, 2011, 5:57 PM

                                  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>
                                  
                                  blu42media Function5 12 Replies Last reply Jun 16, 2011, 11:16 AM Reply Quote 0
                                  • blu42media
                                    blu42media last edited by Jun 15, 2011, 5:41 PM Jun 15, 2011, 5:41 PM

                                    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

                                    Function5 1 Reply Last reply Jun 15, 2011, 5:57 PM Reply Quote 0
                                    • 1 / 1
                                    1 out of 17
                                    • First post
                                      1/17
                                      Last post

                                    Got a burning SEO question?

                                    Subscribe to Moz Pro to gain full access to Q&A, answer questions, and ask your own.


                                    Start my free trial


                                    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.

                                    • See all categories

                                    Related Questions

                                    • Cassie_Ransom

                                      Do long UTM codes hurt SEO?

                                      Since most UTM codes/URLs are longer than 70ish characters, is this hurting my SEO? If it is, how can I solve the problem while still using a UTM code? Thanks!

                                      Technical SEO | Nov 16, 2018, 7:30 PM | Cassie_Ransom
                                      0
                                    • Greenery

                                      Google displays multiple titles for same article. What does this mean?

                                      I've linked to some screenshots so that it what I'm talking about makes more sense. Sometimes, when I perform a search, I see an article with the correct article title listed as the page title in the SERPs. Other times, I see the wrong page title – it's a generic somethin' or other done by my client's web design company with a bunch of keywords thrown in. The latter (not the correct article title) also appears at the top of the browser tab for every article on my client's site. I know this is bad, but what can be done about it? This would never happen if my client used Wordpress or some easily modifiable CMS, but they're using a proprietary one maintained by the group that designed the website. open?id=0BxB_dYL1ylGgVVF1dHlwdXp2dFU open?id=0BxB_dYL1ylGgdWJjdlJoRlRIR00

                                      Technical SEO | Jun 20, 2017, 9:54 PM | Greenery
                                      0
                                    • promodirect

                                      How to show number of products in your Google SERP?

                                      I have used to rich snippet to my website & everything is working fine except showing the total number of products listed in the particular category. Check out the screenshot below: aH7XM

                                      Technical SEO | Aug 10, 2016, 8:17 AM | promodirect
                                      0
                                    • AfroSEO

                                      422 vs 404 Status Codes

                                      We work with an automotive industry platform provider and whenever a vehicle is removed from inventory, a 404 error is returned. Being that inventory moves so quickly, we have a host of 404 errors in search console. The fix that the platform provider proposed was to return a 422 status code vs a 404. I'm not familiar with how a 422 may impact our optimization efforts. Is this a good approach, since there is no scalable way to 301 redirect all of those dead inventory pages.

                                      Technical SEO | Jul 26, 2016, 6:15 PM | AfroSEO
                                      0
                                    • Tz_Seo

                                      How google crawls images and which url shows as source?

                                      Hi, I noticed that some websites host their images to a different url than the one their actually website is hosted but in the end google link to the one that the site is hosted. Here is an example: This is a page of a hotel in booking.com: http://www.booking.com/hotel/us/harrah-s-caesars-palace.en-gb.html When I try a search for this hotel in google images it shows up one of the images of the slideshow. When I click on the image on Google search, if I choose the Visit Page button it links to the url above but the actual image is located in a totally different url: http://r-ec.bstatic.com/images/hotel/840x460/135/13526198.jpg My question is can you host your images to one site but show it to another site and in the end google will lead to the second one?

                                      Technical SEO | Feb 15, 2016, 6:52 AM | Tz_Seo
                                      0
                                    • SouthernAfricaTravel

                                      Google Cache showing a different URL

                                      Hi all, very weird things happening to us. For the 3 URLs below, Google cache is rendering content from a different URL (sister site) even though there are no redirects between the 2 & live page shows the 'right content' - see: http://webcache.googleusercontent.com/search?q=cache:http://giltedgeafrica.com/tours/ http://webcache.googleusercontent.com/search?q=cache:http://giltedgeafrica.com/about/ http://webcache.googleusercontent.com/search?q=cache:http://giltedgeafrica.com/about/team/ We also have the exact same issue with another domain we owned (but not anymore), only difference is that we 301 redirected those URLs before it changed ownership: http://webcache.googleusercontent.com/search?q=cache:http://www.preferredsafaris.com/Kenya/2 http://webcache.googleusercontent.com/search?q=cache:http://www.preferredsafaris.com/accommodation/Namibia/5 I have gone ahead into the URL removal Tool and got denied for the first case above ("") and it is still pending for the second lists. We are worried that this might be a sign of duplicate content & could be penalising us. Thanks! ps: I went through most questions & the closest one I found was this one (http://moz.com/community/q/page-disappeared-from-google-index-google-cache-shows-page-is-being-redirected) but it didn't provide a clear answer on my question above

                                      Technical SEO | Sep 25, 2014, 11:20 AM | SouthernAfricaTravel
                                      0
                                    • DonnaDuncan

                                      Exclude status codes in Screaming Frog

                                      I have a very large ecommerce site I'm trying to spider using screaming frog. Problem is I keep hanging even though I have turned off the high memory safeguard under configuration. The site has approximately 190,000 pages according to the results of a Google site: command. The site architecture is almost completely flat. Limiting the search by depth is a possiblity, but it will take quite a bit of manual labor as there are literally hundreds of directories one level below the root. There are many, many duplicate pages. I've been able to exclude some of them from being crawled using the exclude configuration parameters. There are thousands of redirects. I haven't been able to exclude those from the spider b/c they don't have a distinguishing character string in their URLs. Does anyone know how to exclude files using status codes? I know that would help. If it helps, the site is kodylighting.com. Thanks in advance for any guidance you can provide.

                                      Technical SEO | Jan 26, 2014, 9:29 AM | DonnaDuncan
                                      0
                                    • ZAG

                                      Special Characters in Title Tags & Meta Descriptions

                                      Do special characters, such as the "&" symbol or a "," in title tags and meta descriptions negatively affect your ranking in search engines? Any feedback is much appreciated. Thank you!

                                      Technical SEO | Jul 12, 2013, 1:05 PM | ZAG
                                      1

                                    Get started with Moz Pro!

                                    Unlock the power of advanced SEO tools and data-driven insights.

                                    Start my free trial
                                    Products
                                    • Moz Pro
                                    • Moz Local
                                    • Moz API
                                    • Moz Data
                                    • STAT
                                    • Product Updates
                                    Moz Solutions
                                    • SMB Solutions
                                    • Agency Solutions
                                    • Enterprise Solutions
                                    Free SEO Tools
                                    • Domain Authority Checker
                                    • Link Explorer
                                    • Keyword Explorer
                                    • Competitive Research
                                    • Brand Authority Checker
                                    • Local Citation Checker
                                    • MozBar Extension
                                    • MozCast
                                    Resources
                                    • Blog
                                    • SEO Learning Center
                                    • Help Hub
                                    • Beginner's Guide to SEO
                                    • How-to Guides
                                    • Moz Academy
                                    • API Docs
                                    About Moz
                                    • About
                                    • Team
                                    • Careers
                                    • Contact
                                    Why Moz
                                    • Case Studies
                                    • Testimonials
                                    Get Involved
                                    • Become an Affiliate
                                    • MozCon
                                    • Webinars
                                    • Practical Marketer Series
                                    • MozPod
                                    Connect with us

                                    Contact the Help team

                                    Join our newsletter
                                    Moz logo
                                    © 2021 - 2025 SEOMoz, Inc., a Ziff Davis company. All rights reserved. Moz is a registered trademark of SEOMoz, Inc.
                                    • Accessibility
                                    • Terms of Use
                                    • Privacy

                                    Looks like your connection to Moz was lost, please wait while we try to reconnect.