---
title: "How to Create and Delete a WordPress Page Using WP-CLI"
description: "In This Tutorial: Create a Page Delete a Page WP-CLI is a tool available with any of InMotion Hosting's WordPress Hosting plans. This ingenious suite of tools allows you to work on your WordPress..."
url: https://www.inmotionhosting.com/support/edu/wordpress/wp-cli/how-to-create-and-delete-a-wordpress-page-using-wp-cli/
date: 2018-03-05
modified: 2024-03-11
author: "InMotion Hosting Contributor"
categories: ["WP-CLI"]
type: post
lang: en
---

# How to Create and Delete a WordPress Page Using WP-CLI

## In This Tutorial:

[Create a Page](#create-page) [Delete a Page](#delete-page)

WP-CLI is a tool available with any of InMotion Hosting’s [WordPress Hosting plans](https://inmotionhosting.com/wordpress-hosting). This ingenious suite of tools allows you to work on your WordPress websites from the command line. In this guide, you will learn **how to create and delete a WordPress Page** from the command line using the **WP-CLI** command, *wp post*.

## Add a Page

1.
   1. [SSH into your server](/support/server/ssh/shared-reseller-ssh/) as the cPanel user that owns the website you would like to work with.
   2. Use the cd command to switch to the [document root directory of your website](/support/website/where-to-upload-files/). Example: cd **public_html/wp** **NOTE: **Be sure to replace **public_html/wp** with the actual path to the document root directory of your website.
   3. Run the following command: wp post create –post_type=page

The output will be similar to the example below:

exampl3@example.com [~/public_html/wp]# wp post create --post_type=page Success: Created post 157.

## Delete a Page

1.
   1. [SSH into your server](/support/server/ssh/shared-reseller-ssh/) as the cPanel user that owns the website you would like to work with.
   2. Use the cd command to switch to the [document root directory of your website](/support/website/where-to-upload-files/). Example: cd **public_html/wp** **NOTE: **Be sure to replace **public_html/wp** with the actual path to the document root directory of your website.
   3. Run the following command: wp post delete *156* **NOTE: **Be sure to replace *156* with the actual [ID of the Page](/support/edu/wordpress/wp-cli/how-to-find-post-details-using-wp-cli/#list-page-details) you would like to delete.

The output will be similar to the example below:

exampl3@example.com [~/public_html/wp]# wp post delete 156 Success: Trashed post 156.
**Congratulations!** Now, you know **how to create and delete WordPress Pages, using WP-CLI**.

Learn more about [WP-CLI](https://www.inmotionhosting.com/support/edu/wordpress/wp-cli/), the command-line interface for WordPress, and how to streamline your WordPress maintenance workflows!
