Problem/Motivation

A client defined that as a requirement.

Not quite sure where to put this. I found this old issue in views #988474: Table header ordering links should have rel="nofollow" in the <a> tags which was closed.

As mentioned there, drupal.org has that as a custom robots.txt rule:

# Extras on drupal.org
# no access for table sorting paths or any paths that have parameters.
Disallow: /*?sort*
Disallow: /*&sort*

I guess that's a bit too wide to have by default., no way to know whether people use sort=something and want to have it indexed.

Proposed resolution

Add that in tablesort_header()

Remaining tasks

User interface changes

API changes

Data model changes

Comments

Berdir created an issue. See original summary.

yaremchuk’s picture

Let me take that issue, will work on them on DrupalEurope.

yaremchuk’s picture

Status: Active » Needs review
StatusFileSize
new2.16 KB

it fixed the issue in native drupal tables and in views tables

yaremchuk’s picture

Status: Needs review » Needs work

I just realized that classy and stable overwrite views table templates...

yaremchuk’s picture

Status: Needs work » Needs review
StatusFileSize
new4.6 KB

Also, I have added the same fix in Classy and Stable themes.

Version: 8.7.x-dev » 8.8.x-dev

Drupal 8.7.0-alpha1 will be released the week of March 11, 2019, which means new developments and disruptive changes should now be targeted against the 8.8.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

berdir’s picture

Also found #1758354: Optionally add Robot Meta Tags (nofollow, noindex) to sort links, and Views subpages, with quote from @dawehner:

> As views will land into core such crappy seo stuff shouldn't be there.
> As far as i know you can even fix that with a proper written robots.txt.

Problem is, it doesn't look like the robots.txt approach is actually working, somehow google gets pretty confused about that, we have thousands of warnings in google search console with that approach where google apparently indexed those links but then later complains that they are not allowed. So it seems that adding a nofollow upfront would make sense and avoid those index requests in the first place. I don't think that's "crappy SEO stuff" :)

mbovan’s picture

The patch #5 does not apply anymore.

I rerolled and added the missing test coverage.

borisson_’s picture

Status: Needs review » Reviewed & tested by the community

I agree with @Berdir, this is a good thing to do. I also think that having some best practices in the core for SEO is not a bad thing at all.
For nice search robots, this will reduce server-load as well, making all drupal sites more eco-friendly ;).

It has testcoverage and the patch is really small. It looks like this might be a BC break though but I'm setting this to RTBC anyway to surface this to core maintainers who have more knowledge about BC.

catch’s picture

Status: Reviewed & tested by the community » Needs work
Issue tags: +Needs change record, +Needs frontend framework manager review

This definitely needs a change record to note the change in the templates.

I think the change itself is fine to commit to a minor release, but marking for frontend review to ensure the stable/classy changes are appropriate - I think it might depend if we consider this a feature request or a bugfix. CNW for the change record.

lauriii’s picture

Yeah, could definitely use a change record for the markup change, but other than that this change should be fine to be applied to Stable and Classy in a minor release.

Version: 8.8.x-dev » 8.9.x-dev

Drupal 8.8.0-alpha1 will be released the week of October 14th, 2019, which means new developments and disruptive changes should now be targeted against the 8.9.x-dev branch. (Any changes to 8.9.x will also be committed to 9.0.x in preparation for Drupal 9’s release, but some changes like significant feature additions will be deferred to 9.1.x.). For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

mbovan’s picture

Status: Needs work » Needs review
Issue tags: -Needs change record

I created a draft change record at https://www.drupal.org/node/3092185.

Additionally, I have checked Twig templates added by Claro theme and it has no implementation of views-view-table.html.twig template. That said, #8 should still be commit-ready patch.

mbovan’s picture

Status: Needs review » Reviewed & tested by the community

Since #8 passed 8.9.x tests, the change record was created and the issue was reviewed by the frontend framework manager in #11, I am updating the status to Reviewed & tested by the community as previously set in #9

alexpott’s picture

Status: Reviewed & tested by the community » Fixed

Committed and pushed dc0b137553 to 9.0.x and eb89cf435a to 8.9.x. Thanks!

  • alexpott committed dc0b137 on 9.0.x
    Issue #2999696 by Yaremchuk, mbovan, Berdir: Add rel="nofollow" to table...

  • alexpott committed eb89cf4 on 8.9.x
    Issue #2999696 by Yaremchuk, mbovan, Berdir: Add rel="nofollow" to table...

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.