Fixing Wordpress Title and Description Tag Placement
-
I know how important the title and description tag are and I know it is important to have them place at the top of the code. However, when I view the source on a Wordpress template, I see it looks messy. Here is an example of what the source looks like. Is there a plugin or an adjustment to be made so the code is cleaner? To get rid of spaces and blank lines in code. Or should I just not worry about the way the code looks?
Notice the first example has a break after the <title>, then after the title there is this</p> <p style="color: #5e5e5e;"><strong><em><meta http-equiv="content-type" content="text/html; charset=UTF-8" /> </em></strong></p> <p style="color: #5e5e5e;"><strong><em> </em></strong>then the description? Can that be moved?</p> <p style="color: #5e5e5e;"> </p> <p style="color: #5e5e5e;"><span style="color: #5e5e5e;"><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"></span><span style="color: #5e5e5e;"><br /></span><span style="color: #5e5e5e;"><html xmlns="http://www.w3.org/1999/xhtml" dir="ltr" lang="en-US"></span><span style="color: #5e5e5e;"><br /></span><span style="color: #5e5e5e;"><span> </span><head profile="http://gmpg.org/xfn/11"></span><span style="color: #5e5e5e;"><br /></span><span style="color: #5e5e5e;"><span> </span><title></span><span style="color: #5e5e5e;"><br /></span><span style="color: #5e5e5e;"><span> </span>tite text goes here <span> </span></title> " />
Here there are no breaks after <title>and the <title> is directly above the description</p> <p style="color: #5e5e5e;"> </p> <p style="color: #5e5e5e;"><span style="color: #5e5e5e;"><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"></span></p> <p style="color: #5e5e5e;"><span style="color: #5e5e5e;"> </span><span style="color: #5e5e5e;"><html xmlns="http://www.w3.org/1999/xhtml" dir="ltr" lang="en-US"></span></p> <p style="color: #5e5e5e;"><span style="color: #5e5e5e;"><head profile="http://gmpg.org/xfn/11"></span></p> <p style="color: #5e5e5e;"><span style="color: #5e5e5e;"><meta http-equiv="content-type" content="text/html; charset=UTF-8" /></span></p> <p style="color: #5e5e5e;"><span style="color: #5e5e5e;"><title>tite text goes here</title>
-
RDK is right on. I would add some sites go a step further and compress their html code. This step improves the page loading speed a tiny bit as it saves the browser from having to do this work. Reading the html code becomes much more difficult when all the spaces are removed.
-
Viewing the source will look different, depending on how you're getting the source into an editor. On many CRM (wordpress, joomla, etc) the source code can display differently than it is stored on the back-end.
Luckily, spaces don't matter. They are essentially deleted when a browser renders them.
The title and description tags must be in the section and it doesn't matter where they are within the head section . Just make sure they don't come after the tag.
Don't worry, be happy.
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
-
Affect of ™ and ® in title for SEO
I am looking at adding the trademark and rights reserved symbols to some of my titles. I think this might help with click through rate. From what I have found, this shouldn't have an affect on SEO unless it makes the title too long. Is this correct? Stephen
On-Page Optimization | | stephen.volker1 -
What is the best tag to use for your Logo ?
Hi, I'm wondering what is the best tag to use on your logo. We're currently using h1 and i want to scrap that ASAP.
On-Page Optimization | | Alex.harvey.Cortex0 -
Category descriptions and magento
Hi Any eCommerce experts out there, please? I run a magento store and am looking to improve the performance of my category pages in the listings, to aid this I have created category descriptions - a hundred or so words about what, for example, a Maxi Dress is, an example can be seen here http:// yochic.co.uk/dress-267864/ maxi.html (I have broken the link as not sure on the linking policy of the forum). I have noticed, however, that this category description is appearing all on sub pages of the section, so it is on page 1,2,3,4 etc. Is this likely to lead to me receiving a penalty for internal duplicate content? The store uses rel="next" in all the category pages, so shouldn't that help limit any problems caused by the duplication of the page descriptions? I notice that when I search for a sub page, 2, 3, 4 etc in Google using the url of page two http://yochic.co.uk/dress-267864/maxi.html?p=2 it returns the first page, so am i right in thinking with the tags that Google sees all the sub pages as being page one. In which case, doesn't that limit my ability to rank for the products listed on pages 2+? Long story short, the site cannot rank it's product pages because the vast majority of the product descriptions are 100% duplicate because the site is an affiliate fashion store. Many thanks Carl
On-Page Optimization | | carl_daedricdigital0 -
Adding meta description tags to Drupal 6 content
It looks as if a quick improvement to the (inherited) site that I manage would be to add meta description tags to all our pages. But I don't see a user-friendly way to modify the html headers from within Drupal. I'm debating whether to interpose CSS code between Drupal and the final html content, but I'd face a steep learning curve on CSS. Can you suggest a more excellent approach? Thanks!
On-Page Optimization | | marcellu
John0 -
If Google still shows my old title in the search results then there is no way my title change could have changed my ranking yet right?
If Google still shows my old title in the search results then there is no way my title change could have changed my ranking yet right? In other words if I changed from TItleA to TitleB but search results and cache still show TitleA then any SERP drops or increases would still be entirely based on titleA right? Thanks.
On-Page Optimization | | Rezo0 -
The actual title tag is different from the one showing in SEOmoz
Hello all I was looking at the crawling report for my project, I have noticed that there are so many duplicate titles in the "Duplicate Page Title" report, I checked the title tag for one of the titles (for this page) manually (in the page code), and it was showing like this: <title></span><span>Interviews | TechSparks</span><span></title> where it's showing in the "Duplicate Page Title" report like this: Interviews | TechSparksEasyRotator Preview Hovering over the tab in the browser shows the title as I mentioned first, and searching Google for this page shows the title like the first one I mentioned too. Do you any clue why that is happening? fUbtXe6 fUbtXe6.png
On-Page Optimization | | MHD0 -
WordPress Crawl Errors
I recently added wordpress to my site and get the following errors: Duplicate Page Content http://agrimapper.com/wordpress/ http://agrimapper.com/wordpress/index.php How do I define the canonical page on a .php. 4XX (Client Error) http://agrimapper.com/wordpress/index.phpindex.php Any ideas where the 4XX error comes from. Thanks.
On-Page Optimization | | MSSBConsulting0 -
Are Title meta tag keywords case sensitive'
Hi! One of the fixups that SEOmoz analysis reports is that my main keyword isn't part of the page title. The problema is that the keyrord is there but in uper case while i introduced a lower case keyword for analysis (see the example). BEAUTY (it's in the page title) beauty (that's the keyword i'm analysing) Regards, OV
On-Page Optimization | | ovieira0