WPFTS Pro Main Site WPFTS Community Forum
    • Recent
    • Tags
    • Popular
    • Register
    • Login
    Get WPFTS Pro today with 25% discount!

    [Solved] Polylang limits search by language taxonomy

    Scheduled Pinned Locked Moved Recipes and Known Solutions
    fixpatchpolylangsearchtaxonomy
    1 Posts 1 Posters 997 Views 1 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • EpsilonAdminE Offline
      EpsilonAdmin
      last edited by EpsilonAdmin

      Hi! Sometimes new WPFTS users may notice the strange behavior of the WPFTS search: it works fine in the Sandbox, but the frontend search either makes 0 results, or only the first page of results is present, while the next pages are completely empty.

      This behavior can be the result of the Polylang plugin feature (?) which filters posts by the language taxonomy, so only specific posts/pages (that have the assigned language equals to the current language) can be found at the frontend. All other posts/pages (and attachments too) that have no assigned language will be not found at all.

      We made a simple addon which blocks this Polylang "feature" and allows all posts/pages to be searched at the frontend.

      The code is below.

      add_action('pre_get_posts', function($wpq)
      {
      	if ($wpq->is_main_query() && $wpq->is_search) {
                      // Only execute the code below on frontend main search
                      $wpq->tax_query = new WP_Tax_Query( array() );
      		$wpq->set('lang', '');
      		$wpq->set('tax_query', '');
      	}			   
      }, 99, 1);
      

      You can download it also if you not a pro in coding and/or just don't want to patch theme files.
      https://fulltextsearch.org/wpfts-addon-polylang.zip

      https://e-wm.org

      1 Reply Last reply Reply Quote 0

      Hello! It looks like you're interested in this conversation, but you don't have an account yet.

      Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

      With your input, this post could be even better 💗

      Register Login
      • First post
        Last post

      Suggested Topics

      • EpsilonAdminE

        [Solved] Media Library Folders Pro indexing issue

        Watching Ignoring Scheduled Pinned Locked Moved Recipes and Known Solutions fix mlf media library folders
        1
        0 Votes
        1 Posts
        968 Views
        No one has replied
      • EpsilonAdminE

        [Solved] Search PDF by content in Real3D FlipBook Plugin

        Watching Ignoring Scheduled Pinned Locked Moved Recipes and Known Solutions search pdf real3d flipbook pdfviewer
        1
        0 Votes
        1 Posts
        1k Views
        No one has replied
      • EpsilonAdminE

        How to search posts by shortcode content in Wordpress?

        Watching Ignoring Scheduled Pinned Locked Moved Recipes and Known Solutions feature indexing search shortcode
        1
        2
        0 Votes
        1 Posts
        1k Views
        No one has replied
      • EpsilonAdminE

        [Solved] Files not shown in TemplateToaster theme search results

        Watching Ignoring Scheduled Pinned Locked Moved Recipes and Known Solutions templatetoaster theme search
        1
        1
        0 Votes
        1 Posts
        906 Views
        No one has replied
      • EpsilonAdminE

        [Solved] Incompatibility with Flatbase theme

        Watching Ignoring Scheduled Pinned Locked Moved Recipes and Known Solutions flatbase excerpt theme
        1
        0 Votes
        1 Posts
        963 Views
        No one has replied

      Additional Resources

      • My Account
      • Buy WPFTS Pro
      • Community Forum
      • Affiliate Program
      • Privacy Policy
      • Terms & Conditions
      • Contact Us
      • Coupon Partner

      Be the first to read the news!

      We are always improving our products, adding new functions and fixes. Subscribe now to be the first to get the updates and stay informed about our sales! We are not spammy. Seriously.

      Join Us Now!

      We are a professional IT-team. Many of us have been working in a Web IT field for more than 10 years. Our advanced experience of software development has been employed in the creation of the WordPress FullText Search plugin. All solutions implemented into the plugin have been used for 5 or more years in over 60 different web-projects.

      We are looking forward to your comments, requests and suggestions in relation to the current plugin and future updates.

      ewm-logo-450

      The forum powered by NodeBB | Contributors