angular.js how to tell google to index my site?
I've an angular.js app. I have followed google's guide for ajax based applications. I've done this:
- meta tags
<base target="_blank" rel="nofollow noreferrer" target="_blank" rel="nofollow noreferrer" href="/">
<meta name="fragment" content="!">
- angular.js config
$locationProvider.html5Mode(true);
$locationProvider.hashPrefix('!');
- my html links looks like this(is it wrong?):
<a ng-target="_blank" rel="nofollow noreferrer" target="_blank" rel="nofollow noreferrer" href="/#!/login">Login</a>
- I submitted sitemap into google search console (x months ago)
I found that I should not use escaped_fragment, is it correct? Am I doing something wrong? It's still not indexing. Google indexed just homepage.
When I run fetch as google tool it renders all pages correctly.
Answer
I found that I should not use escaped_fragment, is it correct?
This is correct, as of this official announcement.
Also there was additional best-practice introduced:
For optimal rendering and indexing, our new guideline specifies that you should allow Googlebot access to the JavaScript, CSS, and image files that your pages use. This provides you optimal rendering and indexing for your site. Disallowing crawling of Javascript or CSS files in your site’s robots.txt directly harms how well our algorithms render and index your content and can result in suboptimal rankings.
Taken from the Official Google Webmasters Blog
So, are you allowing Googlebot access to all necessary files?
And how do your URLs look like? Are there also accessible as static HTML? As of the announcements of Google they still recommend the concept of Progressive enhancement, so it might be beneficial in your case to also serve static files.
Related Questions
- → How to update data attribute on Ajax complete
- → October CMS - Radio Button Ajax Click Twice in a Row Causes Content to disappear
- → Octobercms Component Unique id (Twig & Javascript)
- → Passing a JS var from AJAX response to Twig
- → Laravel {!! Form::open() !!} doesn't work within AngularJS
- → DropzoneJS & Laravel - Output form validation errors
- → Import statement and Babel
- → Uncaught TypeError: Cannot read property '__SECRET_DOM_DO_NOT_USE_OR_YOU_WILL_BE_FIRED' of undefined
- → React-router: Passing props to children
- → ListView.DataSource looping data for React Native
- → Can't test submit handler in React component
- → React + Flux - How to avoid global variable
- → Webpack, React & Babel, not rendering DOM