How to Change Front-end Language only in WordPress

To change WordPress language just go to Settings>>General>>Site Language and then select your language from the drop-down. It will change your WordPress admin panel and front-end both. But if you want to change the front-end language only then what should do? Simply just add this filter to your functions.php

add_filter( 'locale', function() {
    return 'bn'; // return ISO langauge code
});

Before doing it, you need to go to Settings>>General>>Site Language, switch the language to the one you want on the frontend only and click Save. This should download it and make it available for use by the snippet of code.

Remember to switch ‘bn’ in this line: return ‘bn’; with the ISO language code for the frontend language you downloaded. See the full list of ISO codes here

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

%d bloggers like this: