SEO - duplicate content divided in different if conditions

Discussion in 'Search Engine Optimization' started by KL76, Dec 16, 2014.

  1. #1
    I am coding a responsive web site where if a mobile device is detected, the page will appear differently. For example the navigation links will appear differently on a mobile page, which will be accomplished using an if statement as shown in the simple example below.

    <?php  if ($mobilePage == "No") {    ?>
    <span class="regularSiteNavLinks">
    <a href="electronics.htm">Electronics</a>     
    <a href="home-garden.htm">Home and Garden</a>     
    <a href="health-beauty.htm">Health and Beauty</a>     
    </span>
    <?php } ?>
    
    <?php  if ($mobilePage == "Yes") {    ?>
    <span class="mobileSiteNavLinks">
    <a href="electronics.htm">Electronics</a>     
    <a href="home-garden.htm">Home and Garden</a>     
    <a href="health-beauty.htm">Health and Beauty</a>     
    </span>
    <?php } ?>
    PHP:
    Since the same navigation links are coded twice on the page, will Google consider this duplicate content? (and penalize the site regarding SEO). Or will the if statement (which will only allow the navigation links to be displayed on the web page once - not twice) prevent the above from being considered duplicate content?

    Thank you!
     
    Solved! View solution.
    Last edited by a moderator: Dec 16, 2014
    KL76, Dec 16, 2014 IP
  2. #2
    They're not coded twice on the page that gets sent to the browser. Your logic is run on the server so Google is oblivious to it.
     
    sarahk, Dec 16, 2014 IP
  3. KL76

    KL76 Peon

    Messages:
    4
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    1
    #3
    Thank you, Sarah! That's what I figured, but I wanted confirmation as I am relatively new to programming. Thanks again!
     
    KL76, Dec 16, 2014 IP