SEO
Last updated
Was this helpful?
Last updated
Was this helpful?
Due to the Isomorphic nature of React apps in Frontity, the first load of any site will be rendered by the server using the React components in the project. Frontity allows you to optimize the SEO performance of your site and customize how your site is indexed by search engine crawlers.
By default, Frontity will deliver to your browser a fully populated and well-formed . This reduces the time required for the first contentful paint and ensures a good SEO score.
But that's not all. With Frontity you can also customize:
Meta tags
robots.txt
You can include the meta tags generated by your WordPress SEO plugin in your React app so they can be properly rendered in the <head>
section of the final HTML
In order to do that you have to use:
The WordPress plugin. This plugin has been developed by the Frontity team and it adds the meta tags generated by your WordPress SEO plugin to the REST API
The Frontity package. This package is designed to automatically get all the data that the REST API Head Tags plugin exposes in the REST API
<Head>
componentBesides the tags added through WordPress plugins you can also customize your <head>
tags from Frontity. The provided by the uses internally, so you can work as if you were working with common HTML.
To adjust the <head>
, you just have to import and write inside <Head>
all the tags you want. Usually, you will want to import it at the index.js
of your theme, in order for it to be loaded on all your pages.
You can, of course, use variables or include code outside <Head>
that will be rendered normally.
robots.txt
You can add the robots.txt
file at the root of your theme (next to the frontity.settings.js
file) and when you build and deploy your app for production, it will be automatically picked up by the Frontity server and served at https://your-site-url.xyx/robots.txt
.
That's all, you just have to configure it at your will. Frontity uses internally. You should check its docs out in case you want to understand it better.
A file tells search engine crawlers which pages or files the crawler should or shouldn't request from your site.
You can also of a theme that is using a robots.txt
file.
Want to know more about SEO & Headless WordPress? Have a look at this
If you still have any questions about SEO in Frontity, please check out the , which is packed full of answers and solutions to all sorts of Frontity questions. If you don't find what you're looking for, feel free to start a new post.