paolopolix paolopolix - 1 year ago 86
AngularJS Question

Search results show Angular placeholders as page titles

I've just uploaded my first angular site. When I check on Google to see whether it is indexed, I see this:

It is the dynamic angular code to set dynamic title/description.. How can I avoid this?!


In order to make pages without hash fragments crawlable, you need to include <meta name="fragment" content="!"> tag in the head of the HTML of your page.

However, full good solution for your case could be

The middleware that you install on your server will check each request to see if it's a request from a crawler. If it is a request from a crawler, the middleware will send a request to for the static HTML of that page. If not, the request will continue on to your normal server routes. The crawler never knows that you are using since the response always goes through your server.

As a custom solution you can use fallback pages

In case the requesting resource doesn’t parse JavaScript, Fallback pages which as HTML pages are displayed instead. Fallback pages which are basically static pages typically try to replicate the functionality and content of JavaScript web application by way of the server-side rendered pages. These pages do comprise of the same content that the JavaScript application would show in addition to making use of standard index-able links for navigation.