Answer the question
In order to leave comments, you need to log in
How to make Yandex/Google bots see text added using preg_replace?
Hello connoisseurs!
I made an SEO module for my own site to change titles, etc., and also added the ability to insert text on the page through preg_replace. The point is that on the desired page, in a random place, we insert a comment and instead of it, the text added to ib is displayed on the page. Everything is displayed on the client (title, keywords, description, h1 and the desired text is displayed in place of the comment. The problem is that for some reason Google / Yandex bots do not see this text, but title, keywords, description, h1 see it normally.
Maybe someone Has anyone already done this and will help solve the problem.Maybe someone will give sensible advice?
Thanks to all who responded! <!--text--><!--/text-->
Answer the question
In order to leave comments, you need to log in
Figured it out myself! Thanks everyone! Manual adaptation of the composite helped!
1. It is necessary to fill in this data through deferred functions. Off.documentation
2. Add OpenGraph markup to the standard ones. Forum
3. If you are using your own components, then make sure that the properties are changed outside the cache.
If you do everything right, Yandex with a buzz will be happy to show everything correctly
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question