i have my website in react java. it was built very earlier. now i am trying to do SEO for my website, but i cannot give a separate SEO title and description for each page. even if i enter the syntax, google is not recognizing it. as, when i click "View Source" for any pages, it opens only the view source of the home page. no other pages are showing in the view source.
when i ask this with some tech persons, he is saying like, the entire website is built like a single landing page, so it will be like that only.
if so, how others can do SEO for their websites?.
is there any solution to solve this issue?
3
Answers
Try react-meta-tags npm library to add meta tags in every component as you want
Lets import react and react-meta-tags at first
At First you should try This:-
for react or simple html site the procedure is same
In your public directory > index.html inside modify them
for title
To Give Title We should Add Our tile in between
<title> my title </title>
Tagfor description
add this tag between
It all depends on what youve created etc.. however adding metadata on your page can be done easily using https://www.npmjs.com/package/react-helmet
If you want pages to be indexable by a search engine, you will need to have a SPA mode and you will also need to render the page using SSR (static site rendering). Otherwise, the Google crawler won’t be able to read it
If you are NextJS or some framework like then it’s easy.
I had a similar problem with a site built in AngularJS.
To solve the problem we create a pre-render service using this lib.
We routed the crawler traffic to the pre-render service.
If done correctly, google & other crawlers will always get fully rendered pages side stepping the SPA issue.