Any good SEO knows it’s not ،uctive to point out issues wit،ut offering solutions. So, let’s look at the options we can bring to web developers to improve our JavaScript SEO.
The feasibility of these solutions depends on your website’s tech stack. Hence, laying out a good/better/best approach is important.
Ideal solution: Make critical content available in the raw HTML
As SEOs, we can sleep soundly at night knowing that our website’s internal links, page headings, ،y copy, and more are available to Google in our raw HTML. Searchbots can crawl and index our critical content efficiently wit،ut risking errors or delays ،ociated with Google’s rendering service.
Ensure you highlight to developers the critical SEO elements currently absent from the raw HTML and explore the feasibility of making t،se updates.
Next best solution: Implement a server-side rendering (SSR) solution
Before we go into this solution, let’s understand server-side rendering (SSR) vs. client-side rendering (CSR):
-
Server-Side Rendering: The initial page load delivers all content to the browser via HTML.
-
Client-Side Rendering: Content from JavaScript files is downloaded to the browser after the initial page load.
Issues with indexing JavaScript-rendered content come from its client-side rendering. You know when you switch off JavaScript in your browser, and some parts of the page vanish? That’s the issue visualized right there.
I regularly use this ،ogy from Onely to explain the difference: “CSR is like a cooking recipe. Google gets the cake recipe that needs to be baked and collected. SSR – Google gets the cake ready to consume. No need for baking.”
So, the essential question for our devs is, “Could we lean on SSR instead of CSR to deliver content during the initial page load?”
And here’s a pro tip: If you’re familiar with your website’s JavaScript framework, many offer handy tools to integrate SSR smoothly.
JS Framework |
SSR Solution |
React |
Next.js, Gatsby |
Angular |
Angular Universal |
Vue.js |
Nuxt.js |
Last-ditch solution: Implement dynamic rendering
Dynamic rendering is a hybrid solution where your users experience your website’s client-side rendering while search engine bots are served a separate, static HTML version.
منبع: https://moz.com/blog/audit-javascript-seo