Post preview gives 404 when permalinks are purely date based

I have an issue pertaining specifically to the situation in which permalinks are set to be based only on publication date. My permalink structure is as follows:

/%year%%monthnum%%day%/

Read More

When I try to preview a post, I get 404. The issue does not come up when I add other URL tags to the structure, like post ID or post name.

I have already tried to diagnose the issue and one thing that came up was that WordPress may be treating URLs consisting only of date tags as date archive pages. Indeed, is_date() returns TRUE when a post page is displayed.

Is there a way around it that does not involve changing permalink structure? Thanks for help.

Related posts

1 comment

  1. I will sum up my findings for future use by others:

    1. When using permalink structure that uses only date tags, WordPress is unable to identify a unique post because there may be more posts in any given day.
    2. For this reason WordPress treats URLs with date based tags only as date archive pages.
    3. Given the permalink structure, WordPress still allows for previewing of posts with present or past publication date (published or drafts) and posts that have publication date set for the future and are still drafts. Previewing posts that are scheduled for future publication and are not drafts, is impossible – they will return the 404 error.

    @Milo, @t3los, thanks for your input.

Comments are closed.