1

I have a modern SPA programmed with Vue. There are links on the website that are not linked to by any page stemming from the home page. They are there for SEO landing page purposes.

Do I need to write a sitemap and link to it in say the footer for search engines to find the pages? Or can they read the js code to find them?

2
  • Can you explain what you mean by "js code to find them"? Google can read links rendered by javascript, but you also say they aren't being linked to from any page.
    – RichardB
    Commented Jun 9 at 17:16
  • They are defined in the vue-router's index.js file.
    – BAR
    Commented Jun 11 at 5:55

3 Answers 3

2

As you say the JavaScript is just for the router and links to those pages aren't being rendered, it is very unlikely that Google will find those pages as it currently stands.

If you'd rather not link to the pages in the footer, then an XML sitemap is different to a sitemap hosted as a page on your site. You can create these and submit them to Google Search Console without having to change your site's code. That will let Google know they exist.

Also, any direct backlinks from external sites to those landing pages should mean Google find them by crawling.

However, as you say the pages are for SEO, you may want to consider the importance of "link juice" flowing through your site. If a page has no links to it (internally or externally), it is unlikely to rank well except for very niche terms.

2

Of course, this is especially true if your links are not directly accessible from your homepage. SPAs can be tricky to crawl because they rely heavily on JavaScript to load content dynamically.

You don't have to put a link to the sitemap in the footer (although it doesn't hurt), but you should submit it directly through the Google Search Console.

Also consider implementing server-side rendering or pre-rendering for your SPA.

0

It is good to have a sitemap for all websites. But as per Google, it is ok for small sizes websites if they do not submit the sitemap in Google Search Console.

I recommend generating a sitemap and submit in Google Search Console as it will help Google to crawl and index the pages on your website easily.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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