Mobile app version of vmapp.org
Login or Join
Angela700

: Is it SEO compatible to set the page title with JavaScript at load time? I want to change some page elements with JS like title h1,h2,h3, p tags and so on. So I want to place in my code

@Angela700

Posted in: #Javascript #Seo

I want to change some page elements with JS like title h1,h2,h3, p tags and so on.

So I want to place in my code something like

$(function() {
document.title = "This is the new page title."
});


So will it be SEO compatible?
I have read some questions like this How to dynamically change a web page's title? and Can I randomly change the page title for users while showing search engines a static title? Some say that it will won't work, but some say that it will work because now google indexes js.

So will it be SEO compatible?

UPD: I want to change title for user and for google bots, for both of them.Just once on page load.
There is always the same h1 for everybody, the changed title is the same for everybody.

Long story:

I need this because I am writing a js plugin.
Something like cms but on our hosting.
Client inputs there h1,h2,h3,h4 title and so on using recomendation of our seo improving program.
He inserts at the end of page script, and script using some api get this values from our server and changes the page.

I know it is somekind of too much complicated. But if it works it will give more customers because customer is lazy and he doesn't won't to make changes in the website by himself sometimes websites don't have cms and he doesn't know html. So this script can be considered like external cms and in theory make customer's life simplier

10.01% popularity Vote Up Vote Down


Login to follow query

More posts by @Angela700

1 Comments

Sorted by latest first Latest Oldest Best

 

@Correia994

I went to nerdydata.com and did a search for document.title = ".
Then i searched for a result with a difference between title and document.title. I found: www.ipts.com/


So i checked Google with site:http://www.ipts.com/ and got the result:



.. so sometimes Google uses / tests other text on the website as title, but the JS document.title is the only location that exact string seems to appear:



Conclusion:
It seems likely that you can set the title via JS. But don't forget, that Google tests other text on your website as title. Maybe even JS strings? With that in mind, i think: If the title "set with JS" is better for Google than the original <title> they will use it.

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme