Last update at :2024-06-09,Edit by888u
Continuing to share WordPress website building tutorials, today let’s talk about the noindex command. Some friends may set it to disable crawling when using WordPress to build a website. If you set it directly in the robots.txt file to disable crawling, that’s okay. You can just modify it later. But if you checked [Recommend search engines not to index this site] when creating WordPress, then there may be some problems, because this option will add a noindex tag to your website. This tag will have no impact on Baidu, because Baidu It is not supported, but it will have a great impact on Google and Bing, because these two search engines will strictly implement this instruction and have a higher priority than the robots.txt file.
As shown in the picture above, if your WordPress site has previously checked [Recommend that search engines do not index this site], even if you cancel it later, the noindex mark will still exist in your website, which is very stubborn! This has a great impact on users who are building foreign trade websites in WordPress. If not handled properly, this will directly affect the effect of your foreign trade website building, because Bing and Google will basically not include your website! So what to do? Next, Yueran Website will share with you the processing method.
//Remove meta robots, code by Yueran wordpress website building collection and organization
add_filter('wp_robots', 'fanly_basic_robots_remove_noindex', 999);
function fanly_basic_robots_remove_noindex( $robots ){ return get_option('blog_public') ? [] : $robots;}
Add the above code to the functions.php file of the current WordPress website theme, save it and clear the cache to take effect. It can also be added directly to the Code Snippets plugin.
Under normal circumstances, as long as there are no restrictions on website crawling, Google search will index the website relatively quickly. It will be basically no problem to receive it in about a week, and it may be possible to include the home page in a day or two. As shown in the picture above, a website built by Yueran was included in Google the next day after removing the noindex mark.
Recommended site searches: cloud server rental platform, Hong Kong cloud server, Henan virtual host, asp website space, US server, Hong Kong server, telecom hosting, what is the server, free personal cloud server outside mainland China, pw domain name, < /p>
发表评论