WordPress Posts
Posts are the main content of a blog. They are shown in the reverse order of date, so the newest post comes first. Posts can be sorted with categories and tags, and they can be shown in an RSS feed. For pages which do not change with time, use pages instead.
How to add a post
- Go to Posts > Add Post.
- Write a title, and then the content in the block editor (learn the editor).
- In the right sidebar, choose the category, tags and featured image, and write an excerpt if you want.
- Click Publish (or Save draft, or Schedule for a future date).
Post status
| Status | Meaning |
|---|---|
| draft | Saved, but not visible to the public |
| pending | Waiting for review by an editor |
| future | Scheduled to publish at a future date |
| publish | Live on the site |
| private | Visible only to logged in admins and editors |
| trash | Deleted, but can be restored for 30 days |
Create posts with WP-CLI
Everything you can do in the dashboard can be done by commands too. This is very useful when you need many posts for testing.
$ wp post create –post_title="My first post" –post_content="Hello from WP-CLI." –post_status=publish –post_date="2026-02-01 09:00:00" –porcelain
5
$ wp post create –post_title="A draft idea" –post_status=draft –post_date="2026-02-02 09:00:00" –porcelain
6
$ wp post list –post_type=post –fields=ID,post_title,post_status,post_date
ID post_title post_status post_date
6 A draft idea draft 2026-02-02 09:00:00
5 My first post publish 2026-02-01 09:00:00
1 Hello world! publish 2026-01-05 10:00:00
The --porcelain flag prints only the new ID. Now we change one post and look at the result:
$ wp post update 6 –post_status=publish
Success: Updated post 6.
$ wp post get 6 –fields=ID,post_title,post_status,post_name
Field Value
ID 6
post_title A draft idea
post_status publish
post_name a-draft-idea
$ wp post delete 6 –force
Success: Deleted post 6.
Slug, excerpt and featured image
- Slug: the last part of the post URL, made from the title (
my-first-post). Keep it short and clear. - Excerpt: a short summary, used by themes in archive lists and by some search results.
- Featured image: the main picture of the post, which the theme shows in lists and at the top of the post.
Revisions, trash and Quick Edit
WordPress saves older copies of a post as revisions, so you can go back. When you delete a post it goes to the trash first. The Quick Edit link in the posts list lets you change title, slug, date, categories and tags without opening the editor.
| Exercises & Assignments |
|---|
| No Content Found. |
| Interview Questions & Answers |
|---|
| No Content Found. |