Search code examples
javascripthtmljquerygoogle-translatetranslate

How to remove the "powered by google translate" and translate web page by google translator from the dropdown of specific languages


I want to remove "powered by google translate" in the header and bottom of the dropdown

enter image description here

I need only specific languages dropdown

enter image description here

code

<!DOCTYPE html>
<html lang="en-US">
  <body>

   <h1>My Web Page</h1>
   <p>Hello everybody!</p>
   <p>Translate this page:</p>

   <div id="google_translate_element"></div>

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

   <script type="text/javascript" src="https://translate.google.com/translate_a/element.js?cb=googleTranslateElementInit"></script>

   <p>You can translate the content of this page by selecting a language in the select box.</p>

 </body>
 </html>

Solution

  • You can add these lines of code in your CSS file:

    body {
    top: 0px !important; 
    }
    
    .goog-logo-link {
        display:none !important;
    } 
        
    .goog-te-gadget {
        color: transparent !important;
    }
    
    .goog-te-banner-frame.skiptranslate {
    display: none !important;
    }