How does <meta> tags inserted using a js affect Google?

Discussion in 'App Development' started by blueraincap, Jan 31, 2021.

  1. Like many websites, I have a bunch of commonly included <head> tags such as <meta>, <link rel="icon">...

    I put them in a header.js file:

    ```
    $(document).ready(function(){
    $("head").prepend('<meta name="description" content="Trump wife is a bitch">');
    $("head").prepend('<meta charset="utf-8">');
    $("head").prepend('<meta name="robots" content="index, follow">');
    ......
    });
    ```

    Then <script src="header.js"></script>.

    How does that affect how my website is crawled and indexed by Google?
     
    • IMO ........ You have to test it yourself.
    • Enter a random made up word such as: fkdier9345ndj
    • Then google it until the lone result is your website - if it even shows up.
     

  2. StackOverflow is the place to ask questions like these.
     

    • Google now returns one result for: fkdier9345ndj
    • Which would be this thread.
     

    • You wouldn't get a straight answer.
    • Nobody knows how Google treats meta tags.
    • So you have to test it yourself.