2

I am building a single-page-application/SPA that uses JavaScript to control all the pages. Naturally, this means only one meta description embedded in HTML, even though there are many different pages with different descriptions across my site. I know it's possible to modify the description meta tag with JS, but will it affect google? Is there any other way to control the description dynamically like this?

2

According to a quick search for "does google search process javascript" this result seems to answer your first question.

Is there another way? Yes, use PHP to build your meta tags dynamically, then they are created before the page is even served.

  • Thank you. Also, PHP is not the only server-side lanugage ;) – markasoftware Mar 11 '17 at 3:58
  • I know that, but it is pretty much ubiquitous and I didn't say it is the only way ;o) – Steve Mar 11 '17 at 4:22
  • Google's pretty on top of things. – wogsland Mar 12 '17 at 17:55
0

Google indexes JavaScript just fine. What you do is not a popular way of changing the meta description but that might be an advantage for you. I would stick with your method!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.