Adding Meta Languange tag to xhtml site - coding help needed
-
I've had my site dinged by Google and feel it's likely several quality issues and I'm hunting down these issues.
One of Bing's Webmaster SEO tools said my xhtml pages (which were built in 2007) are missing Meta Language and suggested adding tag in the or on the html tag.
Wanting to "not mess anything up" and validate correctly, I read in **W3C's site and it said: ** "Always add a lang attribute to the html tag to set the default language of your page. If this is XHTML 1.x you should also use the xml:lang attribute (with the same value). Do not use the meta element with http-equiv set to Content-Language."
My current html leads like:
QUESTION:
I'm confused on how to add the Meta Language to my website given my current coding as I"m not a coder.Can you suggest if I should add this content-language info, and if so, what is the best way to do so, considering valid w3c markup for my document type?
Thank you!!!
Michelle -
thank you!
-
Yeah, I don't think you'll go wrong with "en". Glad to help, hope that answers your question
-
Thanks again George. So, I guess "en" or "en-us" is ok. Most of our customers are in the US by far, but we also have a smaller percent in Australia, Canada and the UK. But they all speak English.
That being said, maybe "en" is best?
Michelle
-
At least with Google, I doubt it makes a difference unless there are multiple languages on a page. If you use Chrome you'll see it auto-detects the language and offers to translate. It may only rank the page in a specific country or locale though. If you're aiming at Spanish speakers in the UK, it may be a little different.
-
Hi Michelle, "ll-cc" stands for "language-countrycode". So in the case of English, you can use "en-us" for English United States or "en-gb" for British English. I don't believe case matters (I have seen "en-US" and "en-GB" used too).
For your question, yes you can use:
You could also use:
Either one will work fine :). Which language are you targeting?
Here is some more reading from w3.org that seems more up-to-date, though I think you would be fine using one of the above methods.
-
The Bing Webmaster Central article where they discuss how to set the language for your pages is here.
-
Hi George,
Thanks for your prompt reply - and I agree - I'm sure this isn't a big factor, but when finding reports saying things are "wrong" - I'm trying to fix them for overall improvement.I noticed w3c says: Always add a lang attribute to the html tag to set the default language of your page. If this is XHTML 1.x you should also use the xml:lang attribute (with the same value).
So, is it best practice to add it (xml:lang) to this tag you suggested (is applicable to my document)?
<html xmlns="http://www.w3.org/1999/xhtml" lang="en">And is "en" preferred over "ll-cc"?
Thanks again,
Michelle -
This is likely what you are looking for, but I don't think this is causing you any SEO problems.
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
-
Complicated Title Tag Issues. Experts, Please Help!
Hey there Moz community! This is the first time I ask a question here so please forgive me if I miss any forum etiquette. I am managing SEO for an educational site which is built in React Js, and so far much of the job has been keyword research and site optimization. The site still has slow PageSpeed though. The Issues - 4 weeks ago we published 20 or so content pieces, I had pre-prepared title tags and meta descriptions. But when we released the content there was a programming error that made all of the pages show another title tag for all 20 pages instead of the pre-prepared individual title tags. I noticed this after 3 days and the issue was fixed within 6 days, but by then Google had crawled and indexed the pages. And now I can't get Google to change to the pre-prepared tags no matter what I do! I've tried changing the content, changing the URL of one of the pages, and I've sent Google spiders to re-crawl the pages multiple times. The super weird thing is that the correct title tag shows in the 'navigation bar/tabs bar' on google chrome: But NOT when I view the source code for the page: Yesterday I was taking a walk in the park and I just couldn't stop thinking about it (it is really starting to get to me by now since nothing works), so I ran back home and looked closely at one of these pages in the Google search console. And I noticed something I hadn't seen before… BOTH of the title tags can be found in the HTML: Pre-prepared title tag: <title></strong>UK Seat Belt & Car Seat Laws: The Definitive Guide<strong></title> The other title tag (in src section): title=Ace%20The%20DMV%20Permit%20Test%20%26%20Get%20Your%20License Could this be the problem or what do you think? I've understood that Google has automated title tags and that they can choose their own if they think it fits better, but the title tags aren't even close to describing the topic as it is now so it doesn’t make any sense. All answers are greatly appreciated! Your advice is life-saving for a learner like me. P.S. I love SEO but it can be very frustrating sometimes! Thank you very much, Leo
Intermediate & Advanced SEO | | Leowa0 -
If I use links intag instead of "ahref" tag can Google read links inside div tag?
Hi All, Need a suggestion on it. For buttons, I am using links in tag instead of "ahref". Do you know that can Google read links inside "div" tag? Does it pass rank juice? It will be great if you can provide any reference if possible.
Intermediate & Advanced SEO | | pujan.bikroy0 -
Google Indexed Site A's Content On Site B, Site C etc
Hi All, I have an issue where the content (pages and images) of Site A (www.ericreynolds.photography) are showing up in Google under different domains Site B (www.fastphonerepair.com), Site C (www.quarryhillvet.com), Site D (www.spacasey.com). I believe this happened because I installed an SSL cert on Site A but didn't have the default SSL domain set on the server. You were able to access Site B and any page from Site A and it would pull up properly. I have since fixed that SSL issue and am now doing a 301 redirect from Sites B, C and D to Site A for anything https since Sites B, C, D are not using an SSL cert. My question is, how can I trigger google to re-index all of the sites to remove the wrong listings in the index. I have a screen shot attached so you can see the issue clearer. I have resubmitted my site map but I'm not seeing much of a change in the index for my site. Any help on what I could do would be great. Thanks
Intermediate & Advanced SEO | | cwscontent
Eric TeVM49b.png qPtXvME.png1 -
Has Anyone Encountered This Old Meta Tag and Know It's Past Function?
name="url" content="http://www.mysite.com/"> I've never personally seen it used until I saw a site using it this past weekend...I cannot find any old documentation on the purpose if this tag either.Any insights or direction would truly appreciated!Many thanks, T 😎
Intermediate & Advanced SEO | | talexanderyano0 -
Breaks in meta |
Hi Does anyone have an opinion on breaks in meta & whether Google reads what is after the break? For example Tubular Shelves | Easy Store Plus | Heavy Duty Shelving Thanks!
Intermediate & Advanced SEO | | BeckyKey0 -
Null Alt Image Tags vs Missing Alt Image Tags
Hi, Would it be better for organic search to have a null alt image tag programatically added to thousands of images without alt image tags or just leave them as is. The option of adding tailored alt image tags to thousands of images is not possible. Is having sitewide alt image tags really important to organic search overall or what? Right now, probably 10% of the sites images have alt img tags. A huge number of those images are pages that aren Thanks!
Intermediate & Advanced SEO | | 945010 -
H Tags Vs "H Style" Tags?
Hey everybody! So I was wondering what the difference between the H tags and "H Style". My first thought is that it's just the style guide, and not actually a meta tag, but before I go around changing all these styles I want to make sure my computer isn't going to explode SEO juice. Thanks!
Intermediate & Advanced SEO | | HashtagHustler0 -
Hierachy in a Title Tag Needed?
When coding the title tags of a website, is it important to note the hierarchy of the website so the search engine can find that page? So, for example, the title tag would be, for a subcategory: Webpage Subcategory>Category>Website name Does this help the search engine rankings at all? Or can the search engines figure out the hierarchy by reading a sitemap or the HTML readable navigation? Then you could focus on the descriptive keywords of the subcategory page for the title tag. Also, should you always include the site name in the title tag?
Intermediate & Advanced SEO | | ConnellyPartners0