• Resolved neileor

    (@roelientimmer)


    Hi,

    I want to disable the hyperlinks to my results.

    When an user does a query I still want to show the results, including the name of page, but I don’t want that the users can click on a link to go the page with the results.

    In shortcodes.php I tried to change:

    $link = get_bloginfo( 'url' ) . "/?s=$term";
    $pre  = "<a rel='nofollow' href='$link'>"; // rel='nofollow' for Google
    $post = '</a>';
    return $pre . do_shortcode( $content ) . $post;

    To:

    $link = get_bloginfo( 'url' ) . "/?s=$term";
    $pre  = "<a class="isDisabled" rel='nofollow' href='$link'>"; // rel='nofollow' for Google
    $post = '</a>';
    return $pre . do_shortcode( $content ) . $post;

    Any tips? (I know it is a bit weird that I don’t want my users to be redirected to the pages they are looking for)

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Mikko Saari

    (@msaari)

    That code only applies to the links generated by the [search] shortcode. If you want to change the search results pages, you need to modify the search results template in your theme to remove the links there.

    Thread Starter neileor

    (@roelientimmer)

    Great, I managed to change it. Thank you so much.

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Disable links to results’ is closed to new replies.