Just deployed your Vue site to production for the first time? Congrats on the launch!
The next step will be to get your site appearing on Google. Here are some tips on doing that.
If your Vue app is a Single Page Application (SPA), Google needs to execute JavaScript to see your content. This can delay indexing and sometimes cause issues.
For better SEO:
If staying with SPA, make sure your hosting supports pre-rendering or use a service like Prerender.io.
If you have multiple domains or subdomains pointing to your main site, you only want one version indexed.
For example, www.example.com and example.com both serve your app, but you only want example.com to appear in Google.
Solutions:
import { useHead } from '@unhead/vue'
useHead({
link: [
{ rel: 'canonical', href: 'https://example.com/current-page' }
]
})
The first step is to submit your sitemap to Google.
You can do this by using the Google Search Console. Creating a Google Search Console property is also useful for monitoring your site's performance in search results.
For Vue apps, you'll need to generate a sitemap. Options include:
public/ directorySubmit your sitemap which will typically be at /sitemap.xml.
Once your sitemap is submitted, you can request indexing of your site. The simplest way to do this is to use the URL Inspection Tool.
If you'd like something more automated, you can use Request Indexing - a free, open-source tool that allows you to request indexing of your site in bulk.
Google Lighthouse is great for showing you issues on your site that may be affecting your SEO.
It's recommended to fix any issues that Lighthouse shows you, as they can affect your site's performance in search results.
I wouldn't be concerned about getting a perfect score and I wouldn't spend too long on the performance side of Lighthouse, but the other categories are important to get right.
You can use Unlighthouse to get Lighthouse reports for your entire site in bulk.
Backlinks are links from other websites to your site. They are one of the most important factors in SEO.
The easiest way to get some initial backlinks on your new site is to share it on social media.
Meta tags not updating:
@unhead/vue correctlySPA content not indexed:
Slow Time to First Byte:
If you're using Nuxt, check out Nuxt SEO which handles sitemap generation, robots.txt, and many SEO tasks automatically.