![]() I use the posts_selection action hook as it's the first hook in WordPress's loading routine that has access to conditional tags. 5 Answers Sorted by: 37 To prevent your PDF file (or any non HTML file) from being listed in search results, the only way is to use the HTTP X-Robots-Tag response header, e.g.: X-Robots-Tag: noindex You can do this by adding the following snippet to the site's root. Remove_action( 'wp_head', 'noindex', 1 ) It seems there is no config for follow, and just setting noindex to true sets the meta robots to noindex, nofollow. Noindex tag tells search engines to crawl the page but not to index or display it in search results. Average pass rate: 96 What is it Check if your webpage is using the robots meta tag or the X-Robots-Tag HTTP header to instruct search engines not to show your site in search results pages. These meta tags are designed to talk directly to search engine programs (bots), who crawl your website. It is one of the methods of blocking indexing on a website. And I am trying to determine is this is indeed the case. Noindex and nofollow are both meta tags that could be added to the HTML source code of a webpage. A noindex tag is an on-page directive instructing search engines not to index the page. Be sure to include the priority for the action or it won't be removed 01-21-2020 12:18 AM We were told by the developer of one of the most popular sitemap and noindex manager apps on Shopify that Shopify forces a NOINDEX, NOFOLLOW when you remove a URL from the sitemap via the API which is crazy. ) Add robots. The most common method of noindex-ing a page is to add a tag in the head section of the HTML, or in the response headers. Your app can inject this snippet on the template, and then add/remove tags based on the user's selection. What is a noindex meta tag A ‘noindex’ tag tells search engines not to include the page in search results. One idea could be to use a code snippet on the collection, page, or product template, containing conditional logic for rendering the HTML for NOINDEX, NOFOLLOW, or NOARCHIVE based on the resource's tags. ![]() ![]() Based off of your comments on my other answer implying that you explicitly wish to keep "Discourage search engines from indexing this site" enabled, after a more thorough investigation of WordPress core source (particularly default-filters.php), I think this is probably what you were after all along: add_action( 'posts_selection', 'indexSearchPage' ) 5 Answers Sorted by: 29 Im normally against exposing staging servers to the public web, but if thats the best solution for your workflow, here are a few things you can consider: Minimal Approach Create new domain for staging server (e.g. Nofollow: tells search engines not to follow the links on your page. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |