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
-
Placement of key words in URL
I notice that the MOZ Page Grader considers "/keyword1/keyword2-keyword3" in a URL string to be less effective than "/keyword1-keyword2-keyword3". Is this correct from Google's perspective? If I am trying to maximise my SEO for the page title "Business building tips", for example, does Google think my URL is more relevant if it's in the form: 1. www.website.com/business-building-tips
On-Page Optimization | | Gavin.Atkinson
2. www.website.com/business/building-tips or
3. www.website.com/business/business-building-tips My instinct tells me 3 is more powerful, but logic tells me if I have a whole section devoted to "business" and one of those pages is "business building tips" then 2 should work just as well, possibly better?0 -
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 -
2 version of meta description and title
Hi guys, I have seen two versions of meta descriptions and meta titles for one URL (this is happening on a few of my pages). Initially, I thought Google is pulling the information from my page content. However, it is not the case. I have realized the information showing on SERPs are very old description (years ago information). Just a bit background information, we had a new website launched in April this year. The issue stated since the new website launch. Anyone experienced similar situation?
On-Page Optimization | | pengiuns-al0 -
Should i make all of my pages with canonical tag
Hi, Im using thesis Wordpress theme, and their default option is "Add canonical <acronym title="Uniform Resource Locator">URL</acronym>s to your site" im just wandering if i should keep that box checked and apply canonical <acronym title="Uniform Resource Locator">URL</acronym>s to all of my pages? Thank You
On-Page Optimization | | Vmezoz0 -
Does the title tag on the home page affect sub-pages?
Hello. I am thinking of changing our home page title tag to include our two most valuable keywords from two of our sub-pages. Would this help the rankings of those two sub-pages? Thank you!
On-Page Optimization | | nyc-seo0 -
Finding unique title tags for each media coverage page
We have multiple pages for our media coverage, and each page has the same title tag. I know it's important to have unique title tags, but if each page is just a listing of your media coverage (page 1 of 9, page 2 of 9, etc) then how do you create unique title tags for each media coverage page?
On-Page Optimization | | msakakibara0 -
Title not showing in Serps
Sorry if I've posted in the wrong section; in a nutshell my page title for 2x key terms (that I've noticed) is not showing in the Serps for my listing. Instead, the keyphrase I'm searching for shows up, and in one case my site name is appended. Can anyone tell me why this is? If I take a stab in the dark, i'd plum for Gg not thinking my page title is up to scratch for the particular search term.... but that's just a punt. Any help, greatly appreciated. Thanks.
On-Page Optimization | | newstd1000 -
Main Page title change.
Hi, For some reason every week or two I am changing the title tag of my main page. Each change takes place because I find new version better than the old one. Does this have any impact on my SEO results (I'm keeping the main keywords each time) ? If it has an impact is it positive or negative ? And should I stick to one title and not change it under any circumstances for long periods of time ? Thanks!
On-Page Optimization | | lolskizz0