• Resolved novusstd

    (@novusstd)


    Hello, i love your plugin but i have one question.

    When i use shortcode to show the reviews i have set use AJAX, but whne i click to second page, the site reload with /page2 or /page3 etc…

    This is very bad for SEO, it’s a possibility to show more review with AJAX witouth add page number?

Viewing 1 replies (of 1 total)
  • Plugin Author Gemini Labs

    (@geminilabs)

    This is how WordPress does comment pagination and how Ecommerce plugins do review pagination. The “reviews-page=2” URL query string ensures that the correct page of reviews is loaded on a page refresh and is seen by search engines. Otherwise, those paginated reviews would not be searchable or indexed on your site by Google.

    I understand the SEO concern, the issue with review pagination (and comment pagination, and product review pagination) is that the page content (excluding the comments/reviews) is identical for each. The more comments/reviews there are on the page, the less of a problem this.

    To answer your question: No, this cannot be done.

    However, here are some things you can do:

    1. Add the canonical tag to your paginated pages

    WordPress already adds this by default to your pages. If your website uses canonical tags, then you shouldn’t have to worry about this particular issue as search engines will know that the page content of paginated URLs are duplicates of page 1, and so they will be treated as the same page.

    To learn more about the canonical meta tag, please see: https://support.google.com/webmasters/answer/139066

    However, if your website is not using canonical meta tags, then you can add them to your paginated pages like this:

    /**
     * Adds the canonical meta tag to paginated review pages
     * @return void
     */
    add_action( 'wp_head', function() {
        if( empty( filter_input( INPUT_GET, 'reviews-page' )))return;
        echo '<link rel="canonical" href="'.wp_get_canonical_url().'">';
    }, 1 );
    

    2. You can also add the page number to the document and page titles for paginated pages

    This may help search engines treat them as individual pages rather than duplicates.

    /**
     * Adds the reviews page number to the document <title> tag
     * @param array $title
     * @return array
     */
    add_filter( 'document_title_parts', function( $title ) {
        if( is_numeric( $pageNum = filter_input( INPUT_GET, 'reviews-page' ))) {
            $title['page'] = 'Reviews Page '.$pageNum;
        }
        return $title;
    });
    
    /**
     * Adds the reviews page number to the page title
     * @param string $title
     * @return string
     */
    add_filter( 'the_title', function( $title ) {
        if( is_numeric( $pageNum = filter_input( INPUT_GET, 'reviews-page' ))) {
            $title = sprintf( '%s - Reviews Page %d', $title, $pageNum );
        }
        return $title;
    });
    

    3. Finally, you can hide your paginated pages altogether from search engines using a robots.txt file

    Doing this will have the exact same result as removing the pagination query string from the URL.

    User-agent: *
    Disallow: /*?reviews-page=*
    

    Learn more about the robots.txt file here: https://developers.google.com/search/reference/robots_txt

Viewing 1 replies (of 1 total)
  • The topic ‘Pagination’ is closed to new replies.