JavaScript SEO: Getting JS on the Google Search Engine Can Be a Bit Tricky

Introduction

I wrote in another article about how much I love jQuery. Definitely jQuery is a great library that makes JS a breeze to use. jQuery can add user interactivity to your web pages so that they come to life. This is why JS is so pivotal to creating actual web applications. A web application is just a really fancy form that you can use to retrieve information from a database. Things become even spiffier when you throw AJAX into the mix. I know that I have recently written a lot about starting and maintaining your WordPress blog. I have also written JS applications and want to talk about them in this article. I want to discuss what you can do to get your JS application onto the Google search engine.

JavaScript and SEO: Making Them Work Together

JS is great because it can do so much to make your web pages animate and move around. A simple blog without any fancy JS works just like a magazine or book. You just read and flip pages. However, a JS application can be very heavy on JS and most often use AJAX to load content-on-the-fly. I touched upon the problem between JS and SEO in this article. The issue that we run into is that search engines are best at reading content that appears in the HTML of your source code. When you right-click on a web page and view the page source, that is the rendered HTML after it has been requested from the web server. Any of your content present on the page source will be read and hopefully added to the search engine. JS complicates matters because it can add content after page load. This is done via AJAX and will be discussed in the next section.

AJAX: Can Search Engines Read Content After Page Load?

Here is the problem with using AJAX to retrieve content from a source like an API or database. When AJAX displays this content, it does not appear in the HTML page source because you are making calls to retrieve more data after page load. Search engines have a hard time retrieving this data because it requires human interaction like clicking a button or scrolling the page to retrieve more data. If these data calls retrieve data that should be added to search engines, then we have a problem. Search engines are unable to process complete JS that tells them that they must click on a button after page load to retrieve even more data to add to their search engine. Some people say that search engines are becoming more sophisticated and that they are smart enough to do this now. I am wary of this statement because you make the assumption that search engines can now read JS and their focus has always been HTML.

Should We Assume That Search Engines Will Go the Extra Mile?

I mean, you can think that search engines can. By making this assumption, you are relying on search engines to go above and beyond their standard reading of HTML. In other words, you are making search engines work harder than they should to get your JS application on Google. I would not rely on search engines to know how to parse your JS and be able to complete the event handlers needed to generate more content. If the search engines find that to be too much work, they can simply refuse and just stick with whatever HTML that you have on initial page load. I will discuss a couple of popular scenarios that use AJAX. Then I will later talk about a solution so that JS and SEO can work together.

AJAX Examples

I will give a couple of AJAX examples that you may have seen online. This is just to give you an idea of what AJAX is when you see it online. You are more likely to see these kinds of features on a website that is more complicated like e-commerce or social media. Definitely a blog will not really have these features because of its focus on content over functionality. This is why people love blogs to bring traffic to their website because content is SEO. This is why you may have heard of the phrase “content is king”. This just simply means that the content is the main factor for driving SEO to your website because content has keywords and the search engines thrive on them.

Show More Content Buttons

This is a common situation where you see AJAX being used. You click on a show more content button and you can read more of something like a product description or additional information. Sometimes we have so much information to show that we cannot show it all at once. Either the overflow of information will not fit into a designated container or will cause the page to load slower. This is why AJAX is used to resolve these issues with displaying overflow content.

Infinite Scrolling

Another common use of AJAX is to show more content as you scroll more. This has started to become an alternative to paging because it requires no clicking through pages. Instead you just keep scrolling until you find something that you like. There are ways to resolve these issues with SEO so the best thing to do is just to build your JS application and make it work how you want it. Paging is still used because it creates links that you can share with others. If you go through a long list of results, then you send someone a link to page two or ten. Infinite scrolling can still page technically, but that requires changing the URL in the browser using the hashtag to remember where you are while infinitely scrolling. This gets a little too complicated because what constitutes page two or five in a page scroll. In other words, how many scrolls constitute one page?

This is More of a Concern for Applications, Not Simple Blogs

Simple blogs usually will never have these issues because they do not require AJAX to show more content in most cases. Every blog is different and who knows where you will take yours in the future as it grows and gains a large following. If you ever have the need to show more content on-the-fly that might have issues with SEO, then you should really think where you are going in terms of JS. This is why I said this article is mainly for SEO when it comes to JS applications and not simple blogs. I do like to bring up blogs because that is what most people want, a blog. An application and blog are two very different things. An application is very complex because of its use of JS events and AJAX. A blog is very simple and requires the minimal amount of JS to run.

Getting JS and SEO to Co-Exist

There is a way to get your JS and SEO to work together. Basically you need to create another section of your website dedicated to just keyword rich SEO content. As mentioned earlier in this article, any content generated via JS might have issues being read into a search engine. So you need to let the JS application do what it needs to do and not try to force it into the search engines. In doing so, you might be compromising the quality of your application. Web applications are already complicated due to the amount of JS needed to make them work. So the last thing that you want to do is make all of its content readable to search engines. Do not do that, I have a solution to this issue. In the next section, I will talk about having a dedicated blog for SEO. 

Create a Dedicated Blog Section Separate from the JS Application

You can use a blog on your website to promote your JS application. The reason why this will work is because you want to keep your JS application and blog separate. Your JS application is mainly to provide your users with data using a complex intricate form. Leave it alone and all of that excess overflow content that loads on-the-fly after page load via AJAX can go to your blog. You are basically shifting that content over a page that can serve it to search engines at page load. You will need to be creative when creating copy that will have some of the dynamically generated content from your application. This will make it so that you can still get the benefits of SEO and have your application work as intended. 

Direct Traffic from Your Blog to Your JS Application

What you can do is link to your application from your blog. You will need to do this because this way, you can get people from the search engines who are looking for your application to use it. Chances are, if your application has very little content in the page source, then it will be hard to find in the search engines. So you need a way for people to find your application once they arrive at your website. You might want to use a reusable block with a button if you are using the Gutenberg block editor. Then you can promote your application at the end of every blog article with a call-to-action to go to your application. This is a good way to convert users over from the search engines. So your blog articles will serve as the link between search engines and your application. 

Thin Content is No Problem for a JS Application

If your application relies mainly on dynamically generated content, then you pretty much have thin content as far as search engines are concerned. No matter how much dynamic content your application generates and changes through JS, the content is still considered thin. You can find out easily when you check the source of the application and see what kind of HTML is there. Now that you will use a blog to compensate for your thin content, you should be good to go. You no longer have to worry about your application no having enough content because your blog will take care of it.

Let the Application and Blog Perform Their Separate Roles

This was mentioned earlier that the application and blog should do what they are best at. I want to delve into this a little bit more. Basically, this is like running an organization and you have people with different roles. Each person is a specialist in their role and only performs their role since they are the best at it. The people never cross roles and they interact with each other when they need to. The blog articles are the ones who will find users on the search engine. Then the articles will pass those people onto the application. Then the application takes over and serves people the information that they need from the website.

How Popular JS Widgets Work With SEO

I examined a few different JS widgets and wrote articles about them and their issues with SEO. Take a look at these articles if you are implementing them because I share my insights with how to get them to play well with search engines. There is a lot of compromise involved because when JS is involved, dynamically generated content is not always clear cut as content that is generated on page load and shown in the HTML.

Here are the articles for a few different JS widgets:

Summary

This article is meant for the case where you have a JS application running on your website and you are trying to get it to show up on the Google search engine. As discussed, it is very hard to get search engines to read any content that JS generates. The reason why is because JS generates content after page load and search engines are best at reading page content at page load. Some say that search engines can read JS generated content but we should still make it as easy as possible for search engines to read content. Just like you make your pages easier for people to use. You should do the same thing for search engines. Just think about it. If your JS application is too hard for the search engines to read, then they will just move on to the next website. Google does not need to add your website to their search engine. Google can choose from other websites in your niche instead so you have to think about it that way.

1 thought on “JavaScript SEO: Getting JS on the Google Search Engine Can Be a Bit Tricky”

Leave a Comment