payloadcms / payloadcms/payload
Website Template shows unpublished posts in archive block
@denolfe is already working on this.
Since Feb 14, 2026.
- Dominant language
- TypeScript
- Stars
- 44.8k
- Forks
- 4.2k
- Avg merge
- 2d 21h
- Merged PRs (30d)
- 53
Description
Describe the Bug
Running the website template with seeded demo data: When unpublishing a post, it will not show up anymore on the posts page and the related posts section (at the end of a post on an individual post's page) as expected but it will still show up on the home page in the archive block. The expected behaviour would be that it also does not show up in the archive block.
The reason seems to be that overrideAccess: false is not being used when fetching the posts for the archive block. Therefore also posts with draft status will be fetched and shown. Clicking on a post with draft status in the archive block will lead to a 404 error page.
Adding overrideAccess: false to payload.find in templates/website/src/blocks/ArchiveBlock/Component.tsx seems to fix the issue.
Link to the code that reproduces this issue
https://github.com/payloadcms/payload
Reproduction Steps
- Create Payload app with website template
- Seed database with demo content
- Unpublish a post
- Visit home page and see unpublished post still showing up in archive block leading to a 404 when clicked
Which area(s) are affected?
area: templates
Environment Info
Binaries:
Node: 25.3.0
npm: 11.6.2
Yarn: N/A
pnpm: 10.28.1
Relevant Packages:
payload: 3.73.0
next: 15.4.10
@payloadcms/db-sqlite: 3.73.0
@payloadcms/drizzle: 3.73.0
@payloadcms/graphql: 3.73.0
@payloadcms/live-preview: 3.73.0
@payloadcms/live-preview-react: 3.73.0
@payloadcms/next/utilities: 3.73.0
@payloadcms/plugin-form-builder: 3.73.0
@payloadcms/plugin-nested-docs: 3.73.0
@payloadcms/plugin-redirects: 3.73.0
@payloadcms/plugin-search: 3.73.0
@payloadcms/plugin-seo: 3.73.0
@payloadcms/richtext-lexical: 3.73.0
@payloadcms/translations: 3.73.0
@payloadcms/ui/shared: 3.73.0
react: 19.2.1
react-dom: 19.2.1
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.