Set permalink to a four-digit year?

[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]
4 Comments
  1. 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

  2. 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.

  3. 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/])

 

This site will teach you how to build a WordPress website for beginners. We will cover everything from installing WordPress to adding pages, posts, and images to your site. You will learn how to customize your site with themes and plugins, as well as how to market your site online.

Buy WordPress Transfer