Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Author bennettmcelwee

    (@bennettmcelwee)

    This happens for some users, usually because some other plugin or the theme is causing double page fetches. If you can easily disable all other plugins, then please do and see if the problem goes away. If you can’t easily do this, then please let me know which other plugins you are using, and what theme you are using. I will see if I can help.

    Thread Starter Juergen Schulze

    (@1manfactory)

    Hello,
    wouldn’t it be easy to catch up by yourself with this flaw caused by others.
    Just divide the results by two if you get 2 results.
    I am checking right now for the plugins. It’s not caused by the them
    Juergen

    Plugin Author bennettmcelwee

    (@bennettmcelwee)

    The trouble is that sometimes there are 2 searches recorded because someone really has searched twice. I can’t just assume that two searches for the same word is an error. I will think about how I can work harder to detect duplicates. But it would help if I could know which other plugin or theme is triggering it (since it doesn’t happen with new WordPress installs).

    Plugin Author bennettmcelwee

    (@bennettmcelwee)

    I’ll close this issue for now since there’s been no reply for 2 weeks. Please raise a new topic if the problem persists.

    Hi. Sorry for reopening this issue, but I have the same problem, but I know exactly what is the cause. I am using custom function to beautify the search url. Here is my code from functions.php:

    function fb_change_search_url_rewrite() {
      if ( is_search() && ! empty( $_GET['s'] ) ) {
        wp_redirect( home_url( "/search/" ) . urlencode( get_query_var( 's' ) ) );
        exit();
      }
    }
    add_action( 'template_redirect', 'fb_change_search_url_rewrite' );

    Any idea how to fix this? Maybe even adding option into settings to ignore double search count. Or is there maybe some option to disable the logging which I can add into my function so it will disable it before the redirect?

    Plugin Author bennettmcelwee

    (@bennettmcelwee)

    The trouble is that the search is logged before the redirect. I will have to investigate why this is: I would expect template_redirect to get called before Search Meter’s the_posts hook, but apparently not.

    I will let you know what I discover.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Double Search Count’ is closed to new replies.