• Resolved nipun5perera

    (@nipun5perera)


    Please add a condition like below to prevent redirections from happening on search page. I know there is another topic with the same issue. Thought this should be included in the future update of the plugin.

    add_filter('template_redirect','me_spr_permalink_redirect');
    function me_spr_permalink_redirect($permalink) {
        global $post;
    
          if(!is_search()) {
            $url = get_post_meta($post->ID,'me_spr_post_redirect',true);
            if (!empty($url)) {
              wp_redirect($url,301);
              exit;
            }
          }
    
        return ;
    }
    • This topic was modified 4 years, 6 months ago by nipun5perera.
Viewing 1 replies (of 1 total)
  • Plugin Author imemine

    (@imemine)

    Hello @nipun5perera

    Thanks for the suggestion. Please make sure you’re on the latest version of the plugin.

    The last update included a code to change to make the redirects work only on single posts.

    if(!is_single()){return true;}

    If you still face issues, please let me know.

    Thanks.

Viewing 1 replies (of 1 total)
  • The topic ‘Redirection happens on search pages’ is closed to new replies.