creating date based urls with pathauto pattern bulk updating all paths

There are a couple more gotchas here than there should be.

Main problem is that if you create a beautiful pathauto pattern making use of a date format named Path date with pattern Y/m/d which produces output like this: 2022/09/11

…without warning the slashes will be stripped from the URL. Which on the one hand makes sense, and on the other hand no there should be explicit options to do or not do that per token.

The workaround is to create each part of the

pattern: ‘[node:created:html_year]/[node:created:path_month]/[node:created:path_day]/[node:title]’

Then, after you run the update from the admin/content page, nothing appears to change. “Update URL alias” does not work in Drupal? – it did not for a while, and maybe there are migration situations where the tracking for gets confused, but generally update automatic URL aliases should work now.

Turns out that not only does this work (it just is often not reflected on the admin/content page right away, but clicking through will redirect to the new path as expected) but the “Update old URL Aliases” option on the Bulk Generate tab of path aliases works as well, and of course is better/easier.


See also:

https://www.drupal.org/project/retro_use_pathauto

And https://www.drupal.org/project/migration_helpers for: