Learn R Programming

wordpressr (version 0.2.3)

delete_wp_page: Delete a WordPress Page

Description

Delete a page on your WordPress site using your WordPress site's API.

Usage

delete_wp_page(root_url, user, pass, page_id, verbose = TRUE)

Arguments

root_url

The domain on which you wish to delete the page.

user

The username to be passed into the API call to delete the page.

pass

The password to be used in the API call to delete the page. To get this value, you must have the Application Passwords plugin installed, and must create an application using that plugin via your WordPress admin panel; there you will get the password needed.

page_id

The ID in the WordPress database of the page to be deleted. You can obtain IDs by using the get_wp_pages() function.

verbose

If TRUE, the page id will be printed to the console. Potentially useful for usage in a single-threaded loop.

Value

response from the API as a list object. Look for the key "deleted" within the list to confirm the post was deleted.

Examples

Run this code
# NOT RUN {
delete_wp_tag(root_url = 'https://domain.com',user = Sys.getenv('username'),
pass = Sys.getenv('password'),page_id = 12)
# }
# NOT RUN {
# }

Run the code above in your browser using DataLab