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
-
Website Titles in Google
I currently have a Wordpress platform website and previously I noticed that when I optimized my pages, if I indicated what I wanted my page names to be (through an application like SEO Yoast) that most times, the keyword would show up exactly how I had it typed in. Recently I have noticed that the title of my website is showing in my page titles too. So for example: Before: Shoe Stores Windsor - XYZ Company Now: XYZ Company | Shoe Stores Windsor - XYZ Company In SEO practices, I know it's most often best to have the keyword you would like as close to the front of your title tag, but now this recent search adds my website title first. Plus this also seems to be making my titles longer. I know Google ultimately has the 'final say' in a page title and I have ensured that I have the "rewrite titles/descriptions option" check in Wordpress to allow me to overwrite titles, but I am hoping someone can possibly provide me with a tip or trick to avoid this in search rankings. I think it's important to have the name of my site entered through Wordpress so that any pages that I have no optimized default to the page name and site name, but the ones I have optimized seem to be showing differently all of a sudden. Any help is greatly appreciated! Thanks!
On-Page Optimization | | MainstreamMktg0 -
Html to wordpress
I have an html site and most of my pages are ranking well. I want to switch to wordpress but i am afraid that i will loose ranking on my inner pages. Any thoughts? And should i do a redirect or use a html plugin
On-Page Optimization | | benjaminmarcinc0 -
Title Attribute Length + Use
Hi, Is there an optimum character limit for attribute titles like there is for meta titles? On my ecommerce site I am adding about 280 characters product category page headers to succinctly describe what the page is such as in the example below; MENS BRIEFS + TANGAS We stock a range of mens briefs from leading designer brands that offer popular cuts and fabrics such as mens cotton briefs. You will also discover styles that are a little more risqué for those looking for something more daring in sexy mens briefs and tangas. I have added the following [title attribute] to this header text (MENS BRIEFS + TANGAS)so it displays the following title attribute text when you hover over it. My intention behind this is so that it enables me to provide visitors with access (via assistive reading software or hovering their cursor over the header text) to a bit more information, which they my find useful [title attribute text] - Mens briefs and tangas. These are possibly the most common and long established style of mens underwear, yet they still come in a variety of cuts and styles. The common feature amongst all men’s briefs is that they have a full rear panel that partly or entirely covers the bottom. They will have cut away legs, a pouch at the front and are supported with an elasticated waistband. Briefs and tangas can vary in the amount coverage in the side panels around the hips and top of the legs and the rear. The more revealing and skimpier tanga style usually consists of only a pouch at the front that is supported with an elasticated waistband and a minimalist rear, with no side panels that exposes the hips.[title attribute text] Is this too much? Can search engines penalise me for it? Am I using/misusing title attributes? Thanks
On-Page Optimization | | UnderMe0 -
Title Tags
Would it be wise to change title tags on the fly? ex. NFL regular season is now complete and they are into the playoffs, want to optimize and structure page around new info. Worried about losing current rank. Thanks guys
On-Page Optimization | | TP_Marketing0 -
Page Title - What is better?
Hi SEO Heads, I have another question if someone would be so kind in answering What page title of the 2 below is better for SEO (i) Chocolate Cake|Chocolate Cake Recipe|Xmas Cake or (ii) Chocolate Cake | Chocolate Cake Recipe | Xmas Cake As you can see (ii) Page Title has a space before and after the | (vertical bar) I know the second page title looks better to human eyes but on some pages I had to forego the space so i could fit my keywords in the page title. is this a good idea? Can anyone help me? Cheers Aidan
On-Page Optimization | | aidanlawlor0 -
Lead With Branded Keywords or Descriptive Keywords in Page Title for (Niche) Site?
Our site is hingeheads.com, and our products and product catalog are unique in two ways. For one our product is not something that people are generally aware of, and secondly our entire product catalog consists of different variations of the same product. **Catalog Overview: **http://hingeheads.com/collections/all Product Example: http://hingeheads.com/products/dolphin I keep wondering if it is better to lead the title with "branded keywords" [1] or with "descriptive keywords" [2]? Dolphin HingeHead | Unique Home Decor & Gift Idea | HingeHeads Dolphin Decor Accessories & Unique Gift Ideas | HingeHeads I am currently going with the second solution, but I am always wondering if that's the right/better solution. I am curious to hear feedback from people who have more experience with this than I do. How would you structure the title for our product pages? Thanks! Kai
On-Page Optimization | | hingeheads0 -
Meta Description not displaying in Google
Hi Mozzers, I have a client that wants to change the way the meta description for some of his pages is being displayed. I've tried using the NOOPD and NOYDIR tags and its not worked. This isn't the client but perform this search in Google.ie - "accommodation newry daft" you get this result - http://www.google.ie/#hl=en&sclient=psy-ab&q=accommodation+newry+daft&pbx=1&oq=accommodation+newry+daft&aq=f&aqi=&aql=&gs_sm=e&gs_upl=11197l11712l2l12016l5l5l0l0l0l0l186l851l0.5l5l0&bav=on.2,or.r_gc.r_pw.r_qf.,cf.osb&fp=f5c640577bb5a285&biw=1600&bih=775 See how Daft.com (2nd results down) has the text "10+ items" in the description- my client has this as well as do many other competitors but its not present in the meta description tag. Anyone know how to get rid of this and get the good old meta descrition in the SERPs? Thanks BUsh
On-Page Optimization | | Bush_JSM0 -
How do I fix a 404 with a 301
I understand the need for fixing 404's but I have yet to have a serious walkthrough of how to set up a 301. From all the talk on the forums and such I'm pretty sure this is easy but I've just never done it before and I could really use a walk through. Thanks
On-Page Optimization | | BenRWoodard1