[ad_1]
Is there any way to set a permalink for a page to a four-digit year?
Presently if I try this, WordPress changes the URL to /2023-2. I’m assuming this is because permalinks for posts can be set to use the year as part of the path.
Is it possible to override this or force it to work? The site in question does not use posts and path I want to use (/2023) results in a 404 error at present.
[ad_2]
So when you put /%year%/%postname/ permalink settings, URL shows site.com/2022-2/postname/ ?
This sounds like it should be a page And not a post? Also, if 2 pages/posts have the same name, the perma link will add a “-2” to the end
You’re trying to set the page url to be the same as your year url, so WP adds the -2 to your page url automatically. This is do it can differentiate between the two URLs pointing to two separate resources, that would otherwise be the same URL.
Just add the %year% to your permalink settings like @Mesum showed you.
By default, a page or post cannot have an all numeric slug. This is because then it would conflict with paging numbers in the link. That’s why it’s adding the -2.
You can use a plugin to get around this by sacrificing numeric parts of other permalinks. See this plugin for example: [https://wordpress.org/plugins/allow-numeric-stubs/])