SEO issues with listings

This topic contains 5 replies, has 3 voices, and was last updated by  Naveen Giri 4 years, 1 month ago.

We have moved to a support ticketing system and our forums are now closed.

Open Support Ticket
  • Author
    Posts
  • #533123

    bernieportal
    Expired Member
    Post count: 108

    Hi, I’m trying to improve my website’s SEO and whenever I do site audits I always have issues with my listing pages.

    Is there a way to unfollow my listing “category” and “tag” pages so they aren’t being crawled by google?

    ex: https://www.bernieportal.com/broker/category/group-benefits/

    Thanks

    #533130

    Kor
    Moderator
    Post count: 16516

    Hi Sarah,

    Thanks for your post. You can try using these methods https://www.isitwp.com/nofollow-external-links-only-the_content-and-the_excerpt/ to apply “nofollow” to your links. Could you give it a try and see if it helps?

    #535665

    bernieportal
    Expired Member
    Post count: 108

    Will that work for all (and only) my pages that have the slug “broker”?

    “broker” is my post type.

    bernieportal.com/broker/category/
    bernieportal.com/broker/tags/
    bernieportal.com/broker/united-states/

    I don’t want that script to unfollow any of my pages except for the ones that start with bernieportal.com/broker/

    Thanks!

    #535684

    Kor
    Moderator
    Post count: 16516

    Hi Sarah,

    Thanks for your reply. That code will affect all pages. Let me forward this to a developer for a second opinion.

    Thanks!

    #535694

    Naveen Giri
    Moderator
    Post count: 1559

    Please try it,

    
    add_filter('the_content', 'my_nofollow');
    add_filter('the_excerpt', 'my_nofollow');
     
    function my_nofollow($content) {
        global $gd_post;
        if ( !geodir_is_gd_post_type( 'broker' ) ) {
    		return false;
    	}
        return preg_replace_callback('/<a[^>]+/', 'my_nofollow_callback', $content);
    }
     
    function my_nofollow_callback($matches) {
        $link = $matches[0];
        $site_link = get_bloginfo('url');
     
        if (strpos($link, 'rel') === false) {
            $link = preg_replace("%(href=\S(?!$site_link))%i", 'rel="nofollow" $1', $link);
        } elseif (preg_match("%href=\S(?!$site_link)%i", $link)) {
            $link = preg_replace('/rel=\S(?!nofollow)\S*/i', 'rel="nofollow"', $link);
        }
        return $link;
    }

    Thanks

    #538836

    Naveen Giri
    Moderator
    Post count: 1559

    I can see the category page is already noindex, follow. which means it is already excluded from crawling.

    I will close it.

Viewing 6 posts - 1 through 6 (of 6 total)

We have moved to a support ticketing system and our forums are now closed.

Open Support Ticket