Slower index speed
The single page application problem
The biggest pitfall is building a single page site. If your site only has one page, search engines will only index a single page. It is impossible to fit a significant amount of content onto a single page. If you have one very large page, search engines are not likely to index all the content on it, nor will it be possible to rank for most of the relevant keywords. It is much easier to rank for lots of keywords in search engines when you create lots of pages.
Single page application frameworks are not limited to building single page sites. To such frameworks, "single page" means that users only load your web application on the first page load. Clicking to other pages within it only changes the main content, but doesn't force them to reload the entire web application.
To create multiple pages under a single page application framework:
- Assign each chunk of content to its own URL.
- As users navigate the site, use
pushStateto change the URL they see, even if they are not loading whole new pages.
- Ensure that starting the web application at a deep URL initially shows the content associated with that URL.
<a href=/foo.html> links. When it crawls, Googlebot:
- Dowloads the page
- Downloads all supporting JS and CSS
- Renders the page
1.Indexes the keywords shown in the rendered page
- Scans the document object model (DOM) for
<a>links to other pages so that it knows what to crawl next.
If you don't use links, Googlebot won't be able to find the other pages on your site. It is easy to make the mistake of using some other type of HTML element that users can click on for navigation. However Googlebot doesn't click on anything. It won't try to click on every element to see if it changes the URL. You need to use anchor HTML elements for Googlebot.
return false or
event.preventDefault() within the link's event handler to simulate loading a new page without causing your webapp to reload.
Bots don't interact
Googlebot will only see what is rendered in the
onload event for the page. Once the initial page load is rendered, Googlebot indexes what it find on the page at that point. Googlebot doesn't click, scroll, or otherwise interact with the page. Any content that is shown only when a user clicks on something, scrolls the page, or after any other interaction won't be indexed. You need to ensure that all the words in the page that you want indexed are visible when the page loads without any user interaction at all.
This article was written as part of a series about SEO myths.