php includes and how it effects seo

Discussion in 'Search Engine Optimization' started by raven2424, Dec 20, 2006.

  1. #1
    my site is a php site and works like this i have a index.php it then includes pages in the content area now the thing is that my index.php has

    meta name=keywords,content, etc...

    and so does the page it includes .htm or .php at times. When you view souce you see how theres like 2 head areas im wondering what best for me to do. if you have a lot of experince with seo can you PM me for site link so i can get your opoions on if i should leave it alone or make a change.
     
    raven2424, Dec 20, 2006 IP
  2. DSeguin

    DSeguin Peon

    Messages:
    70
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Only have your main site that includes the other pages has the meta tags, the other pages should not. Having more than one of the same meta tag is definitely not recommended.
     
    DSeguin, Dec 20, 2006 IP
  3. Austars

    Austars Active Member

    Messages:
    1,437
    Likes Received:
    23
    Best Answers:
    0
    Trophy Points:
    95
    #3
    Why not make a single header.php file to include on all pages?
     
    Austars, Dec 20, 2006 IP
  4. raven2424

    raven2424 Well-Known Member

    Messages:
    754
    Likes Received:
    10
    Best Answers:
    0
    Trophy Points:
    160
    #4
    well if the site had 1 header for all pages that would not be as good as if i did SEO on most pages
     
    raven2424, Dec 20, 2006 IP
  5. Nima

    Nima Well-Known Member

    Messages:
    3,489
    Likes Received:
    243
    Best Answers:
    0
    Trophy Points:
    175
    #5
    Search engines view your site by reading the code not the visual output...

    I use php include (it's the best) for my own website (Poker)

    This is the format I use:

    <?php include("common_head.php"); ?>
    
    	<title>Blacksburg Poker</title>
    	<meta name="description" content="" />
    	<meta name="keywords" content="" />	
    
    <?php include("header.php"); ?>
    
    [Content]
    
    <?php include("left_menu.php"); ?>
    <?php include("right_menu.php"); ?>	
    <?php include("footer.php"); ?>
    Code (markup):

    I've found this to work best...

    Cheers,
    Nima
     
    Nima, Dec 20, 2006 IP
  6. The Critic

    The Critic Peon

    Messages:
    392
    Likes Received:
    7
    Best Answers:
    0
    Trophy Points:
    0
    #6
    Each page on my site is divided into three parts: the header, the footer, and the main content. The header includes the nav menu and header bar, the footer contains some closing tags and the footer, and the main content holds everything else, including the meta tags. This way I can just include the header and footer on certain parts of the page to get the final product. Kinda like this:

    
    <html>
    <head>
    meta
    <title>
    <body>
    include(headerinc);
    main content
    include(footerinc);
    
    Code (markup):
    It's SEO-friendly and can save hours if I need to change something.
     
    The Critic, Dec 21, 2006 IP
  7. rmccarley

    rmccarley Peon

    Messages:
    231
    Likes Received:
    17
    Best Answers:
    0
    Trophy Points:
    0
    #7
    Nima - that's pretty close to what I do.

    The Critic - How does the meta tags work if they are in the <body> instead of the <head>?

    raven2424 - The search engines just see what the browser sees: final output. They don't know you are using includes so that part isn't really an issue. The important part about the info in the <head> is you can't repeat your meta description or your page title or Google will throw you into the suplemental index which sucks. Nima's solution is a good one or I have moved to this:

    
    <?
    include(head1.inc);
    include(meta.inc);
    include(head2.inc);
    include(content.inc);
    include(foot.inc);
    ?>
    Code (markup):
    Where "head1" has the doctype, open html and open head tags. "meta" contains just the page title, meta description and meta keywords tags. "head2" has the style sheet links, content-type, favicon link and RSS feed link, closes the head tag, opens the body and has the primary navigation.

    head1 & 2 and foot are all the same, the other files get changed page to page.
     
    rmccarley, Dec 21, 2006 IP
  8. raven2424

    raven2424 Well-Known Member

    Messages:
    754
    Likes Received:
    10
    Best Answers:
    0
    Trophy Points:
    160
    #8
    i think i need someone to take a look at my site and let me know what actions i should take if you have the time and can help drop me a PM so i can show you the site in question.
     
    raven2424, Dec 21, 2006 IP