0
votes

I am using prerender.io for server side rendering for Angular Single Page Application.

  1. Added ngMeta dependency and added the title and description meta tags dynamically.
  2. Added sitemap.xml file with all the URLs
  3. Added the site as a property on Google Webmaster Console.
  4. Rendered the pages using prerender.io

The title and description tags are displayed in page view source as below:

<meta name="description"
    content="{{ngMeta.description}}">
<meta name="robots" content="noodp" />
<meta name="robots" content="noindex" />
<link rel="canonical" href="https://www.example.com/">

<meta property="og:locale" content="en_US">
<meta property="og:type" content="website">
<meta property="og:title" content="{{ngMeta.title}}" />
<meta property="og:description" content="{{ngMeta.description}}" />
<meta property="og:keywords" content="{{ngMeta.keywords}}" />
<meta property="og:url" content="https://www.example.com/"">
<meta property="og:site_name" content="xxx">

But, the rendered page shows the title and description as below:

<meta name="description" content="">
<meta name="robots" content="noodp">
<meta name="robots" content="noindex">
<link rel="canonical" href="https://www.example.com/">

<meta property="og:locale" content="en_US">
<meta property="og:type" content="website">
<meta property="og:title" content="">
<meta property="og:description" content="">
<meta property="og:keywords" content="">
<meta property="og:url" content="https://www.example.com/">
<meta property="og:site_name" content="xxx">

Also, the description is missing for the site on google search.

Can anyone help me to resolve this?

1
We'd love to help if you'd send us a URL of your site that we can test and make sure there aren't any javascript errors when rendering the page. If you could also send over your prerender middleware configuration, that would help us look into it. [email protected] - Prerender.io

1 Answers

1
votes

I removed the line <meta name="robots" content="noindex" /> and I used another plugin called 'angular-update-meta' instead of 'ngMeta'. Now, the google search populates meta description and title.