Skip to navigation
Show only the default language in wordpress post and page list when its translated with polylang
22.12.25
To filter the page list in WordPress to show only the default language when using the Polylang plugin, you can use the following code snippet. This code should be added to your theme's functions.php file or a custom plugin. ``` // List only Default pages in Page and Post list function filter_pages_by_default_language($query) { if (is_admin() && $query->is_main_query() && in_array($query->get('post_type'), ['post', 'page'])) { $default_language = pll_default_language(); $query->set('lang', $default_language); } } add_action('pre_get_posts', 'filter_pages_by_default_language'); ```
https://polylang.pro/?s=show+only+default+language+in+page+list
Reply
Anonymous
Information Epoch 1768663387
Design for visibility.
Home
Notebook
Contact us