link=rel

#404027
  • Resolved Michael Gray
    Rank Math free

    add_filter( “rank_math/frontend/next_rel_link”, function( $link ) {

    $link = $link = site_url().”/listings/page/”.$paged;

    return $link;

    }

    instead of working it is : instead of return and set rel=”” it echoing on page,

    we are trying to change our <link rel=”next” href=”https://hypley.com/listings/page/2/&#8221; />

Viewing 1 replies (of 1 total)
  • Hello,

    Thank you for contacting Rank Math support, and sorry for any inconvenience that might have been caused due to that.

    The $link variable should return the full HTML tag and instead you are trying to return only the actual URL. Please try this code instead:

    add_filter( "rank_math/frontend/next_rel_link", function( $link ) {
        $link = '<link rel="next" href="' . site_url().'/listings/page/'.$paged . '" />';
        return $link;
    });

    Let us know how that goes. Looking forward to helping you on this one.

    Hello,

    Since we did not hear back from you for 15 days, we are assuming that you found the solution. We are closing this support ticket.

    If you still need assistance or any other help, please feel free to open a new support ticket, and we will be more than happy to assist.

    Thank you.

Viewing 1 replies (of 1 total)

The ticket ‘link=rel’ is closed to new replies.