Advertisement

Correct you HTML language declaration in Wordpress

 (Read 3296 times)

Admin

  • Administrator
  • Hero Member
  • *****
  • Posts: 1549
    • The Jucktion
Correct you HTML language declaration in Wordpress
« on: Feb 24, 2015, 05:54 PM »
So i just found out that the html language declaration is somewhat important for search engines to understand which language the page is displayed in. So, i checked our site and the theme doesn't seem to support that feature. And i went ahead and found a code that does this automatically on WordPress and is pretty simple to implement.

Just open up your "header.php" file on the web editor of through FTP, then find the code
Code: [Select]
<html xmlns="http://www.w3.org/1999/xhtml">
and replace with

Code: [Select]
<html xmlns="http://www.w3.org/1999/xhtml" <?php language_attributes(); ?>>
then your html tag with change from simple xmlns declaration to the language declaration in your wordpress settings.

like:
Code: [Select]
<html xmlns="http://www.w3.org/1999/xhtml" lang="en-US" prefix="og: http://ogp.me/ns# fb: http://ogp.me/ns/fb#">
Just a simple trick here though as every single bit helps.

Advertisement

Best Affiliate Program