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
-
Page Title Length
Hi Gurus, I understand that it is a good practice is to use 50-60 characters for the a page title length. Google appends my brand name to the end of each title (15 characters including spaces) it index. Do I need to count what google adds as part of the maximum recommended length? i.e.
On-Page Optimization | | SunnyMay
is the maximum 50-60 characters + the 15 characters brand name Google adds to the end of the title or 50-60 including the addition? Many thanks!
Lev0 -
Different title tags and meta descriptions for desktop and mobile?
Is it possible to use different title tags and meta descriptions for mobile users? For Example: In the SERP for desktop you'll see the desktop title tags and meta descriptions, but in the SERP for mobile you'll the mobile versions of the webpage.
On-Page Optimization | | alex19780 -
"og:description" vs. name="description"
According to Rock Your SEO with Structured Social Sharing "OG description overrides meta description tag." Moz Crawl Diagnostics seems to ignore og:description and only look for meta name="description" - does that mean my meta descriptions tags should be meta name?
On-Page Optimization | | leighw0 -
Meta Description?
Hello! Does anyone know why when Im seeing my page in the serps its not displaying the meta description I have sepcified using my CMS but rather google is pulling a line from the last paragraph I have on the page? Thanks guys!!
On-Page Optimization | | TP_Marketing0 -
Title tag formatting
So I thought I had Title tags cracked... Unique to each page Priority phrases at the start Under 70 characters inc spaces No spamming of keyword phrase Brand at the end But do people believe that this structure is bad? <keyword 1="" phrase="">| <keyword 2="" phrase="">|<brand></brand></keyword></keyword> and that Title tags should now be structure more like full sentences? And does using the same keyword phrase on several pages dilute or cannibalize results? Thanks
On-Page Optimization | | ToonyWoony
Kate0 -
ECommerce Product Meta Descriptions vs. Product Descriptions
Wondering if using on-page product descriptions as the individual product meta descriptions is a best practice for an eCommerce site? Instead of writing two product descriptions (one regular and one meta), I am thinking if the product copy is SEO rich, we'd be good to use just the one for both purposes. Thoughts? Ideas? Suggestions? Seems that many companies follow this practice. Thanks!
On-Page Optimization | | kennyrowe1 -
Can I use the first sentence of my page content as a meta description tag as well?
I just want to copy my content on the page and use the first or as well the second sentence of the content self for my meta description tag. Is that OK? Or should the Meta description tag be different?
On-Page Optimization | | paulinap19830 -
Small Site Title Tag / Structure Question
Bit embarrassed to ask this question, but will ask it anyway! I have done some quite reasonable basic SEO for clients in the south of Spain with small sites and had reasonable success. My wife and I came to the Pyrenees in the south of France to take over and run bed and breakfast in a lovely old farm and some self-catering accommodation in one of the pastures (with my continuing to do a bit of work for clients too). We are running and developing the place for friends who are away 3-4 years. They had an abysmal site, so we designed one to together: http:www.loubetaspyrenees.com/ (I have given the French version because it's what I am most concerned with - there is an English version in case I can tempt you to a holiday here!) It's been very well received by users, so that's great. We have the place on about 12 agencies amd almost all link to our site, so it serves as a good showcase. Here's my issue (for the French site): It went online 11th Feb and is already doing well for more "long tail" searches, and for more local and specific searches, but is proving slow on our prime search terms. The prime market is French, and they key terms are "Gîtes" for the self-catering accommodation, and "Chambres d'Hôtes" for the Bed and Breakfast. Our key Geographical term for the French market is "Hautes Pyrenees" - it's a departmental area. In Google.fr We are around result 100 out of 600k results for "Chambres d'hôtes hautes pyrénées" and aren't in the first 200 for "Gîtes Hautes Pyrénées". This is a competitive market and we are competing with optimised and long-established agencies but still hope to do better. I know I am losing from poorly constructed title tags cannibablising the results, but cannot see how to solve this: Home Page Title tag: "Gîtes et Chambres d'Hôtes dans les Hautes Pyrénées | les Baronnies" I have two main pages on the Gîtes: Gîte for 2-3 people Title tag "Gîte dans les Hautes Pyrénées pour 2-3 personnes en les Baronnies"
On-Page Optimization | | PeterMurray
Gîte for 3-9 people Title tag "Location Gîte dans les Baronnies Pyrénées pour groupe 3-9 personnes" ("Location" means rental) Google understood the above and put us no 1 out of over 1miillion results for a search for a gite for 9 people in the south west of France ("gite sud ouest 9 personne") And 2 pages for the Bed and Breakfast: B&B in the farm building: "Chambres d'Hôtes dans les Hautes Pyrénées dans une ferme restaurée"
B&B in gite apartments with sitting rooms: "Chambres d'Hôtes dans les Hautes Pyrénées avec salon et terrasse" I am not sure how to handle the titles for the Home Page and for the 4 subpages - sounds silly, but have you any advice on how I might handle these titles better? I thought of using more general terms on the Home Page ("Holiday accommodation in the ..."), but on such a small site (18 pages in each language version) I feel that would be unwise. It seems I must try to find some way of differentiating the titles on the other 4 pages so that i am not cannibalising but where there are so few alternatives I am not sure how! Oh dear, sorry this was so long!0