This topic contains a post which is marked as Best Answer. Press here if you would like to see it.
*

Ajit Sahane

  • ****
  • 147 posts
  • https://bestclassifiedsusa.com
Search Page /2 noindex nofollow how to remove
« on: January 24, 2020, 12:05:10 PM »
Hi

my site view-source:https://xyz.com/abc/pqr/2

here
<meta name="robots" content="noindex, nofollow" />
<meta name="googlebot" content="noindex, nofollow" />

want category pagination search page index follow

other theme just static pages are noindex nofollow by default but we can modify.

but beta theme where we can edit to get index follow for /2   search pages ...?


*

MB Themes

Re: Search Page /2 noindex nofollow how to remove
« Reply #1 on: January 24, 2020, 01:45:48 PM »
@Ajit
It should be done by default (page 2,3... removed from search) as it mostly leads to duplicated content.
  To get fast support, we need following details: Detail description, URL to reproduce problem, Screenshots

*

Ajit Sahane

  • ****
  • 147 posts
  • https://bestclassifiedsusa.com
Re: Search Page /2 noindex nofollow how to remove
« Reply #2 on: February 04, 2020, 02:37:27 PM »
But i want to show all pages index follow ... How ..?


*

MB Themes

Re: Search Page /2 noindex nofollow how to remove
« Reply #3 on: February 04, 2020, 03:15:04 PM »
@Ajit
In file:
oc-content/themes/beta/search.php

you have:
Code: [Select]
  <?php if( osc_count_items() == || Params::getParam('iPage') > || stripos($_SERVER['REQUEST_URI'], 'search') )  { ?>
    <meta name="robots" content="noindex, nofollow" />
    <meta name="googlebot" content="noindex, nofollow" />
  <?php } else { ?>
    <meta name="robots" content="index, follow" />
    <meta name="googlebot" content="index, follow" />
  <?php ?>

change it to:
Code: [Select]
  <?php if( osc_count_items() == )  { ?>
    <meta name="robots" content="noindex, nofollow" />
    <meta name="googlebot" content="noindex, nofollow" />
  <?php } else { ?>
    <meta name="robots" content="index, follow" />
    <meta name="googlebot" content="index, follow" />
  <?php ?>
  To get fast support, we need following details: Detail description, URL to reproduce problem, Screenshots

Marked as best answer by frosticek on February 07, 2020, 03:31:50 PM
*

Ajit Sahane

  • ****
  • 147 posts
  • https://bestclassifiedsusa.com
Re: Search Page /2 noindex nofollow how to remove
« Reply #4 on: February 07, 2020, 02:56:19 PM »
Thanks for updating the above solution but this is not perfect.

How ...

xyz.com/for-sale     ---  index / robots - follow   --   ok
xyz.com/search       ---  index / robots - follow   --   ok     here dont want follow - want nofollow

xyz.com/for-sale/1  ---  pagetation pages --  index / robots - follow   --   ok

So, I am referring to some other theme code and modified as per below & this is the perfect solution that I want.

<?php if( osc_count_items() == 0 || stripos($_SERVER['REQUEST_URI'], 'search') ) { ?>
<meta name="robots" content="noindex, nofollow" />
<meta name="googlebot" content="noindex, nofollow" />
<?php } else { ?>
<meta name="robots" content="index, follow" />
<meta name="googlebot" content="index, follow" />
<?php } ?>

Now output --->

xyz.com/for-sale     ---  index / robots - follow   --   ok
xyz.com/search       ---  index / robots - nofollow   --   ok   

xyz.com/for-sale/1  ---  pagetation pages --  index / robots - follow   --   ok


hope the above new solution work well for everyone.