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
-
Can we change Title and/or Descriptions Dynamically Based on Search Query
If I recall we used to be able to change our title attributes tag dynamically based on the search query but not sure if it's possible now or if it makes sense to do so. Thoughts? Rosemary
On-Page Optimization | | RosemaryB1 -
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 -
How should a ALT TAG Be?
Hi All, Can a ALT Tag have special characters? Can i have my ALT Tag as Image-explained-with-what-it-is? Can i have - hyphens as this? Thanks I have a 2nd question I have 100's of videos which has a ALT tag as Tumbnail link to video How can i deal with them? Can i add the Video title as ALT Tag? thanks
On-Page Optimization | | Nettv0 -
Title tag length
Hi, I am fairly new to SEO and have just noticed the end of my title text has been cut off by Google in the serps results. Everything i have read tells me titles should be maximum of 70 characters, however, Google is only displaying 54. See below Security systems | wireless | battery powered | Police... Nobody else on the page is showing more than 54 characters. Am i missing something obvious? Any and all help gratefully appreciated. Thanks Si
On-Page Optimization | | DaddySmurf0 -
Title Tag: Phrases vs. Keywords Separated by "|"
Hello, One of my client's old sites has all category titles of the form (for example) running shoes | running shoe | walking shoes | walking shoe including many that perform well with over 60 characters. I'm in the process of rewriting the titles into something like Running and Walking Shoes, A quality shoe at OurShoes.com The reason I'm rewriting them is for future google penalties, and to look better to possible guest post opportunities. Also to look better in the SERPS But the old style is performing very well. What are the real pros and cons of each? Thanks.
On-Page Optimization | | BobGW0 -
Are meta tags useless?
I thought they were, but I don't work for a full-fledged SEO agency. I'm a copywriter at a marketing firm so my SEO efforts are generally limited to inserting keywords into on-page content, page titles, and URLs. However, one of our clients works with an SEO agency. Whenever we add a new page to the client's website, they ask the SEO agency for keyword recommendations, which are then passed along to us to implement. The recommendations always include meta tags, so I guess I was wrong about them being useless? Can anyone tell me the purpose of meta tags? Thanks!
On-Page Optimization | | matt-145670 -
Fixed horrible title tag on home page, and lost ranking. Will it come back?
I was helping out someone on their site and its home page ranked on page 2 for their term, and the title tag was horrible. It was 160 characters long with lots of near repetitive keywords ([keyword] - adjective [keyword] - adjective [keyword] - adjective [keyword] etc.) -- typical title that Google would penalize when it got around to it. So I created a title that made sense, for the keyword, and that followed the best practices of Google recommendations. Now it's dropped off the index. (EDIT: sorry, still in index, just not even in top 1000) Is this something I should not have done? I was just trying to keep them from getting slammed. And, how long should I expect it to take to get my ranking back? This is the only page title I changed.
On-Page Optimization | | bizzer0 -
Keywords vs Tags In Wordpress
Whats the difference between Keywords vs Tags In Wordpress? Also sine meta keywords don't matter in a website do they matter on a blog?
On-Page Optimization | | splashmedia0