How to Remove Powered By Google Translate Text

calendar_month 10 May 2022 | Javascript


In this tutorial, you will learn how to remove powered by google translate text, when you add the Google Translate script code to your website, the text "Powered by Google Translate" will automatically appear below the language selection box.

You can remove "powered by google translate" text by making some changes to the "googleTranslateElementInit" function.

Let's see the output preview.

Preview:

how-to-remove-powered-by-google-translate-text-before-after

Now, remove powered by google translate text, follow the steps below.

Default function “googleTranslateElementInit” function

<script type="text/javascript">
function googleTranslateElementInit() {
  new google.translate.TranslateElement({pageLanguage: 'en'}, 'google_translate_element');
}
</script>

Change it to

<script type="text/javascript">
function googleTranslateElementInit() {
  new google.translate.TranslateElement({pageLanguage: 'en'}, 'google_translate_element');

  var $googleDiv = $("#google_translate_element .skiptranslate");
  var $googleDivChild = $("#google_translate_element .skiptranslate div");
  $googleDivChild.next().remove();

  $googleDiv.contents().filter(function(){
  	return this.nodeType === 3 && $.trim(this.nodeValue) !== '';
  }).remove();

}
</script>

Now you have a language selection box without "Powered by Google Translate" text.

Read Also: How to Add Google Translate to Your Website

Ashwani Kumar

I'm a dedicated full-stack developer, entrepreneur, and proud owner of buildwithphp.com. I reside in India, where I draw inspiration to create helpful tutorials and tips for fellow artisans. I'm deeply passionate about technologies like Bootstrap, PHP, CodeIgniter, Laravel, Node, React, JavaScript, and jQuery. I believe in working hard consistently, which keeps me motivated and driven. Challenges are opportunities to learn, setbacks are lessons. I find inspiration in the endless potential of technology and aim to make a meaningful impact with my work.

Buddy! I hope you relished the tutorial, and it was good to see you again. Keep learning. Keep visiting.

Related Tutorials
View all