wordpresswpbakery

How could I change WPBakery button text or language?


I just started creating WP page with motors theme and it uses WPBakery builder. Now I added one of their STM widget. I can change all text in it but couldn't find how to change 'search' button text. Maybe you have any suggestions?

enter image description here


Solution

  • To edit strings inside of a plugin, there is a very good plugin for that:

    https://wordpress.org/plugins/loco-translate/

    With Loco Translate you can find strings inside of plugins / themes and edit them. This will work in most cases.

    If Loco Translate does not solve your problem (remember to clear your caches), you can also look for the string inside the body of your page and replace it with javascript. Place this code at the end of your page, maybe inside the footer.php of wordpress. If it is not working, try changing "search" to "Search" or "SEARCH", so to make sure the plugin is not using another variant of the string (because of uppercase, you cannot see this). You can also inspect your page with your browser inspector and look what string exactly is inside the button without the css-style of text-transform: uppercase;

    This code will replace all occurrences of the string "search".

    <script>
        document.body.innerHTML = document.body.innerHTML.replace(/search/g, 'your string');
    </script>
    

    Another solution would be to change the innerHTML of your button with javascript. This way, you are accessing your button element (i.e. by ID) and then set the content of this element with javascript:

    document.getElementById("buttonID").innerHTML = "Text of button";