Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

SEO affected Changing Title Tag by Javascript [duplicate]

Tags:

html

seo

I am having a doubt regarding to this issue where let's say my page load is

<title>Test Only</title>

and I change the value by using javascript to

<title>Test Use JS Change</title>

// this is my Javascript code to update the <title> value after page load
$(function(){
    $('title').html('Test Use JS Change');
});

May I know for Search Engine Bot, will they recognize my title as Test Use JS Change or Test Only

It is because when I see the browser tab/ inspect element to view dynamic source, the title has been updated but when I purely view source only, it shows the default title that I defined.

Would need some advise regarding to this. Thanks!

like image 271
Keith Yeoh Avatar asked Jun 02 '15 06:06

Keith Yeoh


People also ask

Are duplicate title tags bad for SEO?

If you're using duplicate title tags, you're not optimizing SEO for the best possible user experience. This can be detrimental to your SEO. Next, duplicate title tags create more work for search engines and puts them in the position of making decisions for you.

Does changing page title affect SEO?

The page title tag is critical for SEO as it affects how Google's algorithms understand your content and rank your page. Changing your page titles leads to either a positive or negative change in your search engine rankings, visibility, and traffic for your primary target keywords.

Do title tags affect SEO?

Title tags are important for SEO because search engines use them to understand the contents of the page. Title tags also influence the user's decision to click on your page in the Search Results. Great page titles promote the contents of the page and incentivize users to click on them.

Does JavaScript impact SEO?

In the latter, the JavaScript helps to create some special effects, but the core content--the most important information--appears as HTML. This means that the JavaScript does not impact the ability of Googlebot to read and understand the site and thus does not impact SEO.


1 Answers

You can use JavaScript. Some bots, including Google, will execute the JavaScript for the benefit of SEO (showing the correct title in the SERP).

document.title = "Google will run this JS and show the title in the search results!";

Articles showing positive results: http://www.aukseo.co.uk/use-javascript-to-generate-seo-friendly-title-tags-1275/ http://www.ifinity.com.au/2012/10/04/Changing_a_Page_Title_with_Javascript_to_update_a_Google_SERP_Entry

Don't always assume a bot won't execute JavaScript. http://searchengineland.com/tested-googlebot-crawls-javascript-heres-learned-220157

Google and other search engines know that the best results to index are the results that the actual end user will see in their browser, including JavaScript.

like image 186
yazzer Avatar answered Sep 28 '22 19:09

yazzer