In order for the Yandex robot to correctly index your site using AJAX, it scans the original URL address and performs a JavaScript code. To verify the correct setting of indexing and the state of pages in the search, it is recommended to use the JavaScript rendering tool.
If you used to use metatheg before meta name="fragment" content="!" To indicate the version of your AJAX pages, the Yandex robot will ignore it and will index the original pages. For the correct indexing, configure the page version of the page using the parameter ?_escaped_fragment_=(пустое значение), For example: http://www.example.com/?_escaped_fragment_=.
Previously used parameter #! To indicate -the page version should be replaced with more modern methods, since Yandex no longer takes into account such fragments. Here are a few recommendations:
Change the structure of links in your SITEMAP file so that they do not contain a symbol #.
If the symbol is used in exiles on AJAX pages #, replace these addresses with a URL without a fragment, for example, using History API.
To ensure proper indexing in Yandex, do not use fragments in links (<a href="#/example">Example</a>). Instead, use the History API. This API allows manipulating the browser history, which helps to ensure the availability of content through standard URL addresses.
An example with fragments that will not be indexed:
<nav><ul><li><a href="#/clothes">Clothes</a></li><li><a href="#/shoes">Shoes</a></li></ul></nav>
Here is an example of corrected links available for indexation:
<nav><ul><li><a href="/clothes">Clothes</a></li><li><a href="/shoes">Shoes</a></li></ul></nav>
Using the History API also allows manipulating a browser history when clicking on links:
<script>
function goToPage(event) {
event.preventDefault();
const hrefUrl = event.target.getAttribute('href');
const pageToLoad = hrefUrl.slice(1);
document.getElementById('placeholder').inner = load(pageToLoad);
window.history.pushState({}, window.title, hrefUrl);
}
document.querySelectorAll('a').forEach(link => link.addEventListener('click', goToPage));
</script>To preserve all important indicators, such as positions and transitions, configure 301 redirects from old pages to new ones. For example, if you previously used a link http://www.example.com/?_escaped_fragment_=blog, redirect it to http://www.example.com/blog.
If the symbol was used in links #, configure the redirect from the address http://www.example.com/#!blog on http://www.example.com/blog.
To accelerate the indexation -versions of the pages of your site, send them to Yandex through webmasters tools using addresses in format http://www.example.com/?_escaped_fragment_=blog. After the posts fall into the search results, the links will be conducted on the AJAX page of your site.
If the pages of your site do not fall into the search results for a long time or were excluded, and also if you have other questions about setting indexing, you can contact us through the feedback form or use contacts below:
For optimization issues and SEO for your site, write on email: info@seo.computer or through WhatsApp: +79202044461.
ID 153