Problem/Motivation
Follow-up to #3501191.
The fix committed in #3501191 (MR !33) added rel="noindex" to the tab links in src/Plugin/TabRenderer/QuickTabs.php (the added line was: 'rel' => 'noindex',).
rel="noindex" is not a value any search engine supports. Google only recognises nofollow, sponsored and ugc as rel values (see https://developers.google.com/search/docs/crawling-indexing/qualify-outb...), so the attribute is silently ignored.
noindex is a page-level directive: it must be served on the target page as a meta name="robots" tag or an X-Robots-Tag HTTP header (see https://developers.google.com/search/docs/crawling-indexing/block-indexing), never as a rel attribute on a link.
As a result, the /quicktabs/nojs/* URLs keep being crawled and indexed. Because these are the graceful-degradation fallback links (one per tab, per page the block is placed on, per language), the number of indexed, near-empty URLs grows combinatorially. On our site Google reported ~1.65M such URLs.
Steps to reproduce
1. Create a Quicktabs instance with several tabs and place it in a block that appears on many pages (e.g. taxonomy term pages) on a multilingual site.
2. Request a nojs endpoint as a crawler would, e.g. /en/quicktabs/nojs/<instance>/1?quicktabs_path=/node/72.
3. Observe the response: it is a full HTML page (the controller returns an empty render array) with no noindex directive. The only "protection" is the rel="noindex" on the tab links, which search engines ignore.
4. Over time these URLs get indexed and reported in Search Console.
Proposed resolution
Replace the non-working attribute with a valid, effective approach.
1. QuickTabsController::ajaxContent() — the nojs fallback no longer returns an empty render array; it attaches a meta name="robots" content="noindex, nofollow" tag to the page head. Search engines can still crawl the URL and read the directive, so already-indexed URLs are dropped from the index.
2. src/Plugin/TabRenderer/QuickTabs.php — the tab link rel is changed from the invalid noindex to the supported nofollow.
| Comment | File | Size | Author |
|---|---|---|---|
| #5 | quicktabs_noindex_nojs-4.3.patch | 1.73 KB | carlitus |
| #5 | quicktabs_noindex_nojs-4.2.patch | 1.73 KB | carlitus |
Issue fork quicktabs-3612436
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
carlitus commentedComment #4
carlitus commentedComment #5
carlitus commented