Hi All, I have a site that is built with PHP. The pages get their meta tag info from a head.php file so all the other pages have the same meta tag info. I've read that the meta tag information should be page specific, so my question is. Can I just copy and paste the meta tag code in the head.php file to the other files? (with of course changing the key words) and then just comment out the code in the head.php The code I believe I need to work wit is posted below. Any help would be greatly appreciated..... <meta name="******" content="*******" /> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> <meta name="Keywords" content="******/> <meta name="Description" content="*****/> <meta http-equiv="imagetoolbar" content="no" /> I have removed all the key words and such by using the **** Thanks again....
meta tags are supposed to be in <head> ​tag, if you can ensure that in your page files, then that will work.
Hi ronaldsg, Then why in the Google webmaster tool is it saying I have duplicate meta tags on all of my pages? Is there something else I need to do so Google like it? The meta tags are in a head.php file that then shows up in all the other pages... Thanks...
Well, if meta tags are in head.php which is included in all pages, then they are the same. You can either change them depending on page programmatically, like WordPress and other CMS'es does. Also you can move head part to each page and hardcode your meta tags. Something like this <!DOCTYPE html> <head> <meta charset="utf-8"/> <title>page title</title> <link rel="stylesheet" href="styles/css/normalize.css"/> <link rel="stylesheet" href="styles/css/main.css"/> <!-- move content bellow to a page which includes header.php --> <meta name="description" content="your meta description for each page"/> </head> Code (markup):
Google changed its algo recently and the webpages affected who had meta keywords in common. Include your meta tags and then include header.php without meta tags. This will help you. But in this case meta has to be written for every page, which is tedious work if you have hundreds of pages to your website. You can even divide pages into folders with similar contents, keywords etc. You can divide pages over many domains if you can. This may be expensive but very effective.
Hi Zeesales, Thank you for the response, I really don't have a lot of pages to do, so I think that's the direction I would like to go. Can I use the same code that is currently in the head.php file and then just comment it out after I've added it to the other pages? Thanks...
Based on your comments, I think you're confusing head.php and the head section of the page (which exists between the <head> and </head> tags). head.php can be included anywhere in the document (any file can) - it's only in the head of the document if it's included between the head tags.
Hi Rukbat, I don't think I'm confusing head.php and the head section of the other pages, in my head.php it has the code at the top of this post, which is then propagated to the other pages.., with this code; <?php include($pathOffset.'core/head.php'); ?> I realized it as I was looking at the Google Webmaster tool and it is reporting that all the meta tags are the same... Thanks....