Meta tag issues with my PHP based site and Google

Discussion in 'PHP' started by RoadWarriorVPN, Nov 17, 2012.

  1. #1
    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....
     
    RoadWarriorVPN, Nov 17, 2012 IP
  2. ronaldsg

    ronaldsg Peon

    Messages:
    17
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    1
    #2
    meta tags are supposed to be in <head> ​tag, if you can ensure that in your page files, then that will work.
     
    ronaldsg, Nov 18, 2012 IP
  3. RoadWarriorVPN

    RoadWarriorVPN Member

    Messages:
    25
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    26
    #3
    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...
     
    RoadWarriorVPN, Nov 19, 2012 IP
  4. ronaldsg

    ronaldsg Peon

    Messages:
    17
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    1
    #4
    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):
     
    ronaldsg, Nov 19, 2012 IP
  5. zeesales

    zeesales Active Member

    Messages:
    142
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    85
    Articles:
    1
    #5
    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.
     
    Last edited: Nov 19, 2012
    zeesales, Nov 19, 2012 IP
  6. RoadWarriorVPN

    RoadWarriorVPN Member

    Messages:
    25
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    26
    #6
    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...
     
    RoadWarriorVPN, Nov 21, 2012 IP
  7. Rukbat

    Rukbat Well-Known Member

    Messages:
    2,908
    Likes Received:
    37
    Best Answers:
    51
    Trophy Points:
    125
    #7
    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.
     
    Rukbat, Nov 22, 2012 IP
  8. RoadWarriorVPN

    RoadWarriorVPN Member

    Messages:
    25
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    26
    #8
    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....
     
    RoadWarriorVPN, Nov 22, 2012 IP