Support » Plugin: Equivalent Mobile Redirect » Duplicate content

  • Resolved furnituresuppliesuk

    (@furnituresuppliesuk)


    Hello, please can you tell me if I were to duplicate a page to make a lightweight version for mobile will this cause duplicate content issues or does the plugin handle this correctly.
    Thank you

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author uniquelylost

    (@uniquelylost)

    Tags should be added in the <head> section of the pages to tell crawlers about it. The plugin doesn’t automatically do this on its own right now.

    For example:

    On the desktop page (http://www.example.com/) add:

    <link rel="alternate" media="only screen and (max-width: 640px)"
     href="http://m.example.com/">

    and on the mobile page (http://m.example.com/) the required annotation would be:
    <link rel="canonical" href="http://www.example.com/">

    If you have many pages getting redirected and your desktop and mobile pages follow the same URL structure like http://www.example.com/page-1 and http://www.m.example.com/page-1 it would be fairly simple to write out a small script that could be placed in the functions.php that would add the code to the <head> dynamically.

    Plugin Author uniquelylost

    (@uniquelylost)

    If your page slugs exactly match between the desktop and mobile sites you could use the snippets below to generate the tags but make sure to replace the example.com in the code with your domains before using it.

    /* Add to desktop site theme functions.php and make sure to replace domain name */
    add_action('wp_head', 'emr_desktop_head_tag');
    function emr_desktop_head_tag(){
    global $post;
    $emr_page_link = wp_make_link_relative(get_permalink( $post->ID ));
    echo '<link rel="alternate" media="only screen and (max-width: 640px)" href="http://m.example.com' . $emr_page_link . '">';
    };
    /* Add to mobile site theme functions.php and make sure to replace domain name */
    add_action('wp_head', 'emr_mobile_head_tag');
    function emr_mobile_head_tag(){
    global $post;
    $emr_page_link = wp_make_link_relative(get_permalink( $post->ID ));
    echo '<link rel="canonical" href="http://example.com' . $emr_page_link . '">';
    };
    • This reply was modified 2 years, 1 month ago by uniquelylost.
    Plugin Author uniquelylost

    (@uniquelylost)

    closing old support issue, if you have additional questions please open a new thread.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Duplicate content’ is closed to new replies.