MyListing TranslatePress Fix
The {CODICTS} MyListing TranslatePress Fix plugin resolves a critical search incompatibility between the MyListing theme and the TranslatePress multilingual plugin. When a site uses TranslatePress to serve translated content, MyListing’s listing search fails to return results when users search in a non-default language. This plugin automatically fixes that — with zero configuration.
Requirements
Both plugins required: If either MyListing or TranslatePress is not detected, the plugin will display an admin error notice and will not load its search fix.
Installation & Activation
Start by downloading the plugin from the Downloads page on your dashboard on the CoDicts website.
After downloading, install and activate the plugin in WordPress by navigating to “Plugins” > “Add New” > “Upload Plugin” and selecting the downloaded zip file. Click “Install Now” and then “Activate”.
That’s it — no configuration required. The search fix is active immediately for all non-default language searches.
The Problem This Plugin Solves
TranslatePress does not create separate posts for each language. Instead, it stores all translations in its own dictionary tables while the original wp_posts table always contains titles in the default language only. The same applies to taxonomy terms (categories, regions, tags) — they’re stored in the default language in the wp_terms table.
When a user searches on MyListing’s Explore page, WordPress looks for the search term in wp_posts.post_title. If the user is searching in a non-default language, the translated title they’re looking for doesn’t exist in that table — so the search returns zero results.
| Scenario | Without Plugin | With Plugin |
|---|---|---|
| Default language is English. A listing has the title “Bakery.” | (same — both work correctly) | |
| TranslatePress translates the title to French: “Boulangerie.” | (translation displays correctly on the page) | |
| A French user searches for “Boulangerie” on the Explore page. | Zero results. WordPress searches post_title which only contains “Bakery.” | Correct results. The plugin looks up “Boulangerie” in TranslatePress’s dictionary, finds it maps to “Bakery,” and returns the matching listing. |
| A French user searches for a category name in French. | Zero results. Category names are stored in English only. | Correct results. The plugin finds matching translated category names and returns listings in those categories. |
How It Works
The plugin intercepts search queries before they execute and performs the following:
1. Detects that the current language is not the default language.
2. Takes the user’s search term and looks it up in TranslatePress’s translation dictionary table.
3. Finds which original (default-language) post titles or taxonomy term names have translations matching the search term.
4. Returns the matching post IDs or term IDs back to WordPress so the correct results appear.
The fix covers two types of search:
Post Title Search
When a user searches for listings on the Explore page (or via AJAX search), the plugin cross-references the search term against translated listing titles in TranslatePress’s dictionary. Matching listings are returned even though their stored title is in the default language.
Taxonomy Term Search
When MyListing’s search involves category, region, or tag dropdowns/filters, the plugin also cross-references translated taxonomy term names. This covers the following MyListing taxonomies:
| Taxonomy | Description |
|---|---|
| Listing Categories | MyListing’s listing category taxonomy. |
| Regions | MyListing’s location/region taxonomy. |
| Listing Tags | MyListing’s listing tags taxonomy. |
Taxonomy-Inclusive Post Search
By default, the plugin also finds listings that belong to translated taxonomy terms matching the search — not just listings whose title matches. For example, if a French user searches “Boulangerie” and there’s a category translated as “Boulangerie,” all listings in that category are also returned.
Important: The fix only activates when the current language differs from the site’s default language. When searching in the default language, WordPress’s native search works correctly and the plugin does nothing.
Search Term Handling
The plugin handles different types of search input:
| Search Input | How It’s Handled |
|---|---|
boulangerie | Single term — searched directly in the translation dictionary. |
"meilleure boulangerie" | Quoted phrase — treated as a single exact phrase search. |
meilleure boulangerie | Multiple words — parsed and searched as a phrase. |
Available Filters
The plugin provides filters for advanced customization. These are optional — the plugin works without any configuration.
Force the Search Fix on Custom Queries
By default, the fix only applies to job_listing search queries on the frontend in non-default languages. To force it on custom queries, add this to your child theme’s functions.php:
add_filter( 'trp_force_search', '__return_true' );
Disable Taxonomy-Inclusive Post Search
By default, the post title search also includes listings that belong to taxonomy terms matching the translated search. To disable this and search only by translated titles:
add_filter( 'mylisting/explore/keyword-search/include-taxonomies', '__return_false' );
Change the Dictionary Language Table
To modify which TranslatePress dictionary table is queried for lookups:
add_filter( 'trp_change_search_dictionary_language', function( $language, $instance, $query ) {
return 'fr_FR'; // Use French dictionary
}, 10, 3 );
Frequently Asked Questions
Does this require a child theme?
No. The plugin does not override any template files. It hooks into WordPress’s query system at runtime.
Is there a settings page?
No. The plugin works automatically with zero configuration. Activate it and the search fix is applied immediately.
Does this work with MyListing’s AJAX Explore page search?
Yes. The plugin intercepts search queries at the WordPress query level, which covers both traditional page-load searches and AJAX-based Explore page searches.
Does the fix apply when searching in the default language?
No. The fix only activates when the current language differs from the site’s default language. In the default language, WordPress’s native search works correctly because post titles and term names are stored in that language.
Which taxonomies are supported?
The taxonomy search fix covers MyListing’s three built-in taxonomies: listing categories, regions, and listing tags. Custom taxonomies are not included by default.
Does this work with TranslatePress addons (SEO Pack, etc.)?
Yes. The plugin only interacts with TranslatePress’s core dictionary tables. It does not depend on or conflict with TranslatePress addons.
Will this slow down my search?
The impact is minimal. The plugin adds one additional SQL query per search request to TranslatePress’s dictionary table. The dictionary tables are indexed by TranslatePress, so lookups are fast. The query only runs for non-default language searches — default language searches are completely unaffected.
Does the plugin create any database tables?
No. The plugin does not create any database tables, options, or persistent data. It only reads from TranslatePress’s existing dictionary tables at query time.
What happens when the plugin is deactivated?
The search fix is removed immediately. Non-default language searches will return to their broken behavior (zero results for translated terms). No cleanup is needed since the plugin doesn’t store any data.
Troubleshooting
Search Returns No Results in Non-Default Language
| Cause | Solution |
|---|---|
| Translation not saved in TranslatePress | The translated title or term must exist in TranslatePress’s dictionary. Visit the listing page in the translated language using TranslatePress’s visual editor and ensure the translation is saved. |
| Plugin not activated | Go to Plugins → Installed Plugins and verify the plugin is active. |
| Searching in the default language | The fix only applies to non-default languages. Default language search uses WordPress’s native behavior (which works correctly). |
| Another plugin modifying the query | The plugin runs at an extremely high priority (99999999) to ensure it runs last. However, if another plugin modifies post__in after this point, results may be affected. Try deactivating other plugins to test. |
Title Search Works But Category/Tag Search Doesn’t
| Cause | Solution |
|---|---|
| Taxonomy terms not translated | Ensure the category, region, or tag names have been translated in TranslatePress. Visit a page that displays the taxonomy terms in the target language and save translations via the visual editor. |
| Custom taxonomy not supported | The taxonomy fix only covers MyListing’s built-in taxonomies: listing categories, regions, and listing tags. Custom taxonomies are not included by default. |
Search Works in Some Languages But Not Others
| Cause | Solution |
|---|---|
| Missing translations for that language | TranslatePress creates separate dictionary tables for each language pair. Ensure translations exist for the specific language that’s not working. Visit pages in that language with TranslatePress’s editor and save translations. |
“MyListing Theme Not Detected” Error
The MyListing theme must be installed and active. If using a child theme, the parent theme must still be MyListing. Go to Appearance → Themes to verify.
“TranslatePress Plugin Not Detected” Error
The TranslatePress Multilingual plugin must be installed and active. The plugin checks for the free version’s main file (translatepress-multilingual/index.php). If you’re using only a premium version with a different plugin slug, the detection may not work — contact support for assistance.
For further support, visit codicts.com or contact us at support@codicts.com.