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
-
Meta Description
Hey folks, I'm having a little problem with meta description. https://www.google.com/search?q=SSl-5+duncan&oq=SSl-5+duncan+&aqs=chrome..69i57j0l5.3486j0j4&sourceid=chrome&es_sm=91&ie=UTF-8 If you look at that first result it looks like this: Custom Staggered Strat | Seymour Duncan <cite class="_Rm">www.seymourduncan.com/pickup/custom-staggered-strat</cite>Custom Staggered Strat SSL-5. Home; / Pickups ... Maserati tribute - Fender Stratocaster with seymour duncan ssl 5 ... Talk Tone @seymourduncanpickups ...Even while the meta description code is this:name="description" itemprop="description" content="The ultimate overwound Strat single coil pickup, found in the bridge position of the David Gilmour Signature Fender Stratocaster." />We are seeing the same issue here in many places:https://www.google.com/webhp?sourceid=chrome-instant&ion=1&espv=2&ie=UTF-8#q=seymour duncan blogUsing the All In One SEO Pack - Any suggestions as to what might be causing this or how to fix it?
On-Page Optimization | | ScottOlson0 -
Benefits of having a Title-Tag that fits on the SERP
Has anyone seen any case studies that show that title-tags that fit on the page (http://moz.com/blog/new-title-tag-guidelines-preview-tool) have a higher ctr than title-tags that don't fit? I know it's been said that keywords past the pixel limit still matter but if there's a major benefit to ctr for title-tags that fit....Any thoughts?
On-Page Optimization | | GSO0 -
Wordpress blog duplicate issue
So after looking at the set up of the blog ive found this. http://www.trespass.co.uk/blog/ http://www.trespass.co.uk/blog/category/news/ http://www.trespass.co.uk/blog/category/general/ http://www.trespass.co.uk/blog/category/snow/ Content shown on http://www.trespass.co.uk/blog/ can also be found on the other 3 urls. The permalink structure is set up as /%category%/%postname%/ which I want to change to just %postname% Obviously i want to make things as seo friendly as possible so any suggestions to do this right without losing any indexed pages etc. I have limited access to make changes to plugins etc aswell as these need to be done through the development company who manage our site. Cheers Robert
On-Page Optimization | | Trespass0 -
Should I add canonical tag on these pages?
Hi folks I have some pages that used to rank pretty well..but I believe it is affected due to the content similarities. Here is one the sub category pages http://www.ilovebodykits.com/category/98/2/Full-Body-Kits_Duraflex.html the main category page http://www.ilovebodykits.com/category/98/Exterior_Body-Styling_Full-Body-Kits.html These 2 links have very similar contents. The content are dynamic generated by template and I don't think I am able to change content for each individual pages since there are over 2000-3000 of them or more. Should I use canonical tag on the Duraflex.html page to give the main category page all the link juices and credits? There are about 20 other pages like this under this main category. Is it right to canonical all of them? Please let me know if anyone has any suggestion.. thanks
On-Page Optimization | | ilovebodykits0 -
Image Alt and Title?
I'm building a quotations website. Each quotation will have between 1 and 5 images (picture quotes) associated with it. The images will be featured as thumbnails (image gallery) on the quote post itself. How should I handle the image alt and title tags so that I rank better for a quote in image search, and also strengthen the ranking signals on the quote post itself? Take for example, a photo of a beach and a photo of the sun. Both have the same quote on it: "Laughter is an instant vacation." Should the quote itself go into the alt tag? while the description of the image goes into the title? Or should the quote go into the title? Would this be correct? Title: Beach with children playing in the sand. Alt: "Laughter is an instant vacation." Title: Sun shining in the sky. Alt: "Laughter is an instant vacation." What about if the quote is very long? Google has said they like when the alt and title tags are short.
On-Page Optimization | | JABacchetta0 -
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 -
Title Tag Length
Is there a search engine that reads a title tag longer than 70 characters? What is the harm in writing a title tag longer than 70 characters?
On-Page Optimization | | rarbel0 -
How to optimize a wordpress blog
I’m helping a client optimize a word press blog, and I’m not that familiar with Wordpress. The site is www.athleticfoodie.com. At first I was treating it like a normal website, where the categories would be optimized like pages on a website. However, I now realize that categories don’t have any content on them, so I can’t really optimize anything other than the names. Are the following things the best way to handle on-page optimization for a blog? Optimizing the homepage & domain: Find ways to incorporate the most important keywords into the elements on the main frame of the site: Navigation menu, Widgets, Category names, Alt Images. Optimizing the categories: For the posts within the categories (i.e., photos), work to make sure the category keywords are worked into the post titles (but not too much to seem spammy) Optimizing specific posts. Work keywords into the text and images. Any other suggestions would be greatly appreciated.
On-Page Optimization | | EricVallee340