WP Residence Help WP Residence Help

  • WpEstate
  • WPRESIDENCE
  • Video Tutorials
  • Client Support
  • API
Home / 30. WPResidence Translate Plugin / WP_Query Language Filtering

WP_Query Language Filtering

5 views 0

The most invisible — and arguably most important — job of the WPResidence Translate plugin is making sure that every property list, archive, search result, map, and widget on your site shows only content in the visitor’s current language. You never need to pass a language parameter anywhere: the plugin intercepts WordPress queries automatically and keeps them language-aware. This article explains what that means in practice for editors, site admins, and anyone troubleshooting a “wrong language showing up” ticket. For the full picture of how the plugin powers a multi-language real estate website, see the main guide.

Screenshot: Front-end property list page in French showing only French property cards

The Short Version

When a visitor lands on any page of your site, WPResidence Translate reads the active language from the URL and then quietly adjusts every database query on the page so that:

  • Property archives only show properties in the active language.
  • Agent, agency, and developer lists show only profiles in the active language.
  • Related properties, featured sliders, and map pins on the active language site show matching-language listings.
  • Taxonomy filters (city, area, action, category) use the active language’s terms.
  • When a listing only exists in one language, its translation in other languages is resolved automatically if available.

What You Do Not Have To Do

You do not need to:

  • Add a language picker to each shortcode.
  • Pass a language parameter to property search forms.
  • Duplicate widgets per language.
  • Keep a different menu of property categories per language (the taxonomy translation engine handles that too).

As long as a visitor is on the French URL, every query runs “in French”. Switch to English and the same page runs “in English”.

How The Language Is Detected

The current language is detected in this order:

  1. Explicit AJAX parameter (lang) if one was sent with the request.
  2. The URL prefix (e.g. /fr/, /ro/).
  3. The language cookie set by the language switcher.
  4. The visitor’s browser language — matched against the languages you have enabled.
  5. The site’s default language.

Once the language is resolved, it drives every query on the page.

What Happens To Untranslated Content

If a property exists only in English and a visitor is browsing the French site, one of two things happens:

  • On property archives, search, and map queries: untranslated properties are hidden from the French list. Visitors only see properties that have a French variant.
  • On a direct property URL: if the visitor lands on an exact URL for which no translation exists, the original post is still shown — the plugin does not 404 just because a translation is missing.

This rule ensures your French archive never mixes English listings, while also making sure nobody hits a dead link.

Screenshot: Property search result in English with 12 listings and in French with 8 listings, showing only translated properties appear in each

Taxonomy Filters Translate Too

When a query includes a taxonomy filter — for example, “show properties in London” — the plugin automatically swaps the term ID or slug for the correct language’s equivalent before the database is queried. So a visitor on the French site filtering by “Londres” and a visitor on the English site filtering by “London” both reach properties tagged with the linked term.

Custom Field / Meta Filters

Meta queries (searches by price range, number of bedrooms, features, etc.) continue to work unchanged. The plugin knows that fields like price and beds are usually Copy fields — identical in every language variant — so filtering on them in any language returns the same underlying properties, then swaps those properties for their translated versions in the results list.

Troubleshooting “Wrong Language” Situations

Symptom Likely cause Fix
A property appears in the French archive but its title is still English. The French variant exists but has not been translated yet. Edit the property, switch to the French variant, and fill in the title and description.
An English-only property shows up on the French search. The property has no translation link. Check Posts > All Properties, filter by French, confirm the property is actually linked. Re-link it from the editor language panel if not.
Taxonomy filter returns no results in one language. The taxonomy term has no translation yet. Translate the term in WPEstate Translate > Taxonomy Translation.
An Elementor-built template shows wrong-language posts. The widget ID was not remapped for that language. See the Shortcode & Widget ID Remapping article.

Queries That Stay Cross-Language

A few specific queries are intentionally not filtered by language:

  • Admin queries (so editors can see content in every language from the WordPress admin).
  • REST API queries used by the block editor and some headless setups.
  • Elementor template library queries (templates are shared across languages).
  • Navigation menu item queries (menus are translated through a separate sync system).
  • Any query explicitly flagged to “suppress filters”.

This keeps the admin experience fast and the integrations predictable.

Screenshot: WordPress admin All Properties screen listing properties in multiple languages together, in contrast to the filtered front end

Non-Latin Alphabets

Query filtering works identically for every language. Cyrillic, Arabic, Hebrew, Chinese, Japanese, Korean, Thai, and Greek properties are indexed and resolved with full UTF-8 preservation.

What To Read Next

  • URL Structure & Permalinks — where the language prefix comes from.
  • Language Detection & Redirects — the detection order in full.
  • Taxonomy Translation — how taxonomy filters stay language-aware.
  • Meta Sync Across Language Variants — why price filters return consistent results.

For an overview of the whole translation stack that powers a multi-language real estate website, see the WPResidence landing page.

30. WPResidence Translate Plugin

Related Articles

  • String Scanner — Developer Guide
  • The String Scanner
  • Gettext Pipeline & MO Files — Developer Guide
  • Gettext & MO Files — Making Translations Appear on the Front End

WP Residence Documentation

  • 01. Getting Started
    • How to Get Support
    • Get your buyer license code.
    • Use SSL / https
    • Server / Theme Requirements
  • 02. Installation & Setup
  • 03. Installation FAQ
  • 06. Search & Filtering
    • Advanced Search Display Settings
    • Advanced Search Form
    • Geolocation Search for Half Map
    • Save Search Theme Options
    • Advanced Search Colors
  • 09. Agent, Agency & Developers
  • 08. Property Pages & Layouts
  • 07. Property Lists, Categories & Archive
  • 13. WPResidence Elementor Studio
  • 10. Blog Posts & Blog List
  • 11. Shortcodes
    • Contact Form
    • Featured Agency/Developer
    • Membership Packages
    • Testimonials
    • Google Map with Property Marker
    • Listings per Agent, Agency or Developer
    • Display Categories
    • Agent List
    • Recent Items Slider
    • Recent items
    • List Properties or Articles by ID
    • Featured Agent
    • Featured Article
    • Featured Property
    • Login & Register Form
    • Icon Content Box Shortcode
  • 12. Widgets
  • 04. Theme Options & Global Settings
    • General Settings
    • User Types Settings
    • Appearance
    • Logos & Favicon
    • Header
    • Footer Style and Colors
    • Price & Currency
    • Property Custom Fields
    • Features & Amenities
    • Listing Labels
    • Theme Slider
    • Permalinks
    • Splash Page
    • Social & Contact
    • Map Settings
    • Pin Management
    • How read from file works
    • General Design Settings
    • Custom Colors Settings
    • Header Design & Colors
    • Mobile Menu Colors
    • User Dashboard Colors
    • Print PDF Design
    • Property, Agent, Blog Lists Design Settings
    • Sidebar Widget Design
    • Font management
    • How to add custom CSS
    • Custom Property Card Unit – Beta version
    • Email Management
    • Import & Export theme options
    • reCaptcha settings
    • YELP API Integration
    • iHomefinder Optima Express IDX
    • MEMBERSHIP & PAYMENT Settings
    • Property Submission Page
    • PayPal Setup
    • Stripe Setup
    • Wire Transfer Payment Method
  • 20. Translations & Languages
  • 26. FAQ
  • 10. Pages
  • 11. Header
  • 12. Footer
  • 05. Maps & Location Settings
  • 18. Payments & Monetization
  • Plugins
    • 19. Included Plugins
    • 22. Third Party Plugins – IDX Compatibility
    • 21. Third-Party Plugins – Multi-Language
    • 23. Third party Plugins – Other
  • Technical
    • 24. Technical how to | Custom Code Required
    • 25. Technical: Child Theme

Join Us On

Powered by WP Estate - All Rights Reserved
  • WpEstate
  • WPRESIDENCE
  • Video Tutorials
  • Client Support
  • API