Make WordPress Core

Opened 9 years ago

Closed 7 years ago

#31069 closed enhancement (maybelater)

Add month (short)name as a permalink structure tag

Reported by: iseulde's profile iseulde Owned by:
Milestone: Priority: normal
Severity: normal Version:
Component: Permalinks Keywords:
Focuses: Cc:

Description

Instead of example.com/2015/01/post-name/ I would like my permalink structure to look like example.com/2015/januari/post-name/.

It would be nice it this worked out of the box.

Change History (4)

#2 @tyxla
9 years ago

Welcome @iseulde.

It is a nice idea, however I'm not sure if it should go into the core. Basically, if it is implemented, there are two cases:

  1. URLs like 2015/01 would continue working, which would cause content duplication (the same set of posts on two different URLs), which is usually not recommended for many reasons.
  2. URLS like 2015/01 would stop working to prevent duplication, which would break a lot of plugins, themes and custom code which currently relies on that query var structure.

Neither 1, nor 2 would be good IMHO, so I believe this should not be implemented in the core.

Also, it is not clear how this would work with multilingual plugins that use separate URLs for different languages. There would be issues if the month name is the same on 2 or more languages (if using the month name query var for specifying the language). And if the plugin prepends (or appends) the language as a query var or GET parameter, there would be cases where "januari" would not make sense for the current language. These would definitely need ugly workarounds.

In addition to the above, the functionality that you describe can be implemented with a little custom code in your plugin/theme. Basically, this would require you to add 12 rewrite rules (one for each of the months), and eventually to remove the rewrite rules that are created for months by default (to remove duplicate content). This can be done by hooking late on the date_rewrite_rules filter, or on the rewrite_rules_array filter.

#3 @swissspidy
7 years ago

  • Keywords close added

URLS like 2015/01 would stop working to prevent duplication, which would break a lot of plugins, themes and custom code which currently relies on that query var structure.

2015/01 could also redirect to 2015/january

Also, it is not clear how this would work with multilingual plugins that use separate URLs for different languages.

These plugins already need to do lots of workarounds, so… I'd assume most plugins would just say "do not use this permalink structure if you want a multilingual website".

Right now, I don't think adding such a permalink structure is easily possible, thus I'm suggesting wontfix/maybelater.

#4 @SergeyBiryukov
7 years ago

  • Keywords close removed
  • Milestone Awaiting Review deleted
  • Resolution set to maybelater
  • Status changed from new to closed
Note: See TracTickets for help on using tickets.