I have a patch ready that I will post momentarily which expands this module to support any path or URI via direct matching or regular expression matching, and also supports the D8 configuration system so it has a config page and doesn't require editing of the module file.

With this patch, you can go to Configuration > Search and Metadata > Noindex and enter a list of paths and a list of request URIs, optionally with regular expressions using # as a delimiter.

For example, to reproduce the functionality this module had before by using a list of node IDs, you'd configure the paths like this:

/node/123
/node/200
/node/4567

Or if you were so inclined you could apply it to all nodes with a regular expression:
#^/node/[0-9]+#

Or using the Request URI Patterns field, you can search for part of the incoming request URI, including such things as any query string that is in the request.

Issue fork noindex-3002284

Command icon 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

bmcclure created an issue. See original summary.

replicaobscura’s picture

Status: Active » Needs review
StatusFileSize
new24.85 KB

Attached is the mentioned patch. It seems to be working for my use case and in my testing of various options so far.

replicaobscura’s picture

Issue summary: View changes
chapf’s picture

Thank you. Will look into it.

phjou’s picture

StatusFileSize
new25.74 KB
new2.63 KB

Indeed, that patch is really needed. The module is usefull but modify a file of the module to do what you want is not a good practice. Having the config is much better.

The patch works great! I just have done some improvements by fixing coding style and adding the missing schema of the configuration.

replicaobscura’s picture

Status: Needs review » Reviewed & tested by the community

Just a note that we updated to patch 5 and have been using it for a while now successfully!

adamzimmermann made their first commit to this issue’s fork.

adamzimmermann’s picture

Version: 8.x-1.x-dev » 2.x-dev
Assigned: Unassigned » adamzimmermann

I'm working on a new 2.x release that will include D9 support and this functionality.

I'm going to do some final testing and tweaking and get this committed soon.

Thank you for the contribution and testing.

adamzimmermann’s picture

I altered the patch to use \Drupal::service('current_route_match')->getRouteName(); instead of \Drupal::service('path.current')->getPath(); for one of the checks as that seemed valuable to me. The path check seemed redundant since we already had \Drupal::request()->getRequestUri();. In my brief testing, they were returning the same thing.

The entire patch seems to function as intended and work with D9 also.

Perhaps that should be a follow-up issue though. I would be happy to add it back if an issue is filed that explains it!

  • adamzimmermann committed dc49f03 on 2.x
    Issue #3002284 by adamzimmermann, phjou, bmcclure: Expand to support any...
adamzimmermann’s picture

Status: Reviewed & tested by the community » Fixed

Status: Fixed » Closed (fixed)

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