Set your static homepage and posts page

MaintenanceBeginner~5 min

Before you start

Plugin version 1.12.0 or newer, from an administrator connection: reading and writing site settings both need the manage-options capability. Update site settings is off until you switch it on. Both pages must already be published.

You built a proper home page, and the site still opens on a list of blog posts. The fix is in Settings, then Reading: pick “A static page”, choose the home page, choose a page for the blog. It is three fields, but they depend on each other, and a wrong pick sends visitors to an empty page.

This prompt has the agent read what is set now, check both pages, and save all three together.

The prompt
I want this site to open on our [Home] page and show the blog on our [Blog]
page.
Read the current site settings with get-site-settings and tell me what
show_on_front, page_on_front and page_for_posts are now. Then find both pages
with get-pages, published only, and tell me their ids and links so I can check
they are the right ones.
Show me the three values as they are and as they will be, and wait for my go.
Then write show_on_front page, page_on_front and page_for_posts in one
update-site-settings call. Read the settings back afterwards and tell me which
keys landed, which were unchanged, and whether anything else changed during
the call. Keep the old values in your reply so I can switch back.

Why this is safe to run

The first two steps are reads, so you confirm the exact pages by id and link before any write. The write accepts only a short allowlist of site settings. It checks the homepage keys as a set before writing any of them, and an unrecognized key rejects the whole call with nothing written. It can never change the site URL, admin email, default role or open registration.

The response tells you what happened key by key, so a key another plugin reset during the save shows up instead of being reported as a success. There is no undo for site settings in the Changes tab; the old values from the first read are the way back. Update site settings is marked destructive, starts off, needs the manage-options capability, and the call lands in the Activity Log.

For the other basics on the same screens, such as the timezone and posts per page, see tune your site’s basic settings.

Already connected? From an admin connection, ask your agent for the “set your homepage and posts page” recipe, name the two pages, and it runs the same check-first flow on your own site.

How it works

  1. Read the current homepage settings: show_on_front, page_on_front and page_for_posts.
  2. Find the two published pages and confirm their ids with you.
  3. Show the old and new values side by side and wait for approval.
  4. Write the homepage keys in one call.
  5. Read the settings back and report what landed, what was unchanged and anything another plugin changed.

Questions

Can the front page and the posts page be the same page?
No. The homepage keys are checked together before anything is written: the front page and the posts page must differ, and showing a page on the front needs a front page. A request that breaks either rule writes nothing.
What if only part of it saves?
The keys are written in order: page_on_front, page_for_posts, then show_on_front. If one does not land, the call returns an error listing the keys that landed, the ones that were unchanged and the ones that failed. A side_effects list names any homepage key another plugin changed during the call, such as The Events Calendar clearing page_on_front.
How do I go back to showing my latest posts?
Set show_on_front back to posts. The read at the start gives you the old values, and the Changes tab does not cover site settings, so keep them in the chat.