Delete wordpress post

From UBot Studio
(Difference between revisions)
Jump to: navigation, search
(Created page with "'''delete wordpress post''' command deletes a specified post or page from a WordPress website. The post or page is specified by its ID. Make sure to correctly specify the ID...")
 
(Example)
 
Line 9: Line 9:
 
== Example ==
 
== Example ==
 
<pre>
 
<pre>
setup wordpress connection("https://yourwordpresssite.com", "username", "password")
+
connect to wordpress("https://yourwordpresssite.com", "username", "password")
 
create wordpress post("My New Blog Post", "This is the content of my new blog post.", "public", "post", #my post id)
 
create wordpress post("My New Blog Post", "This is the content of my new blog post.", "public", "post", #my post id)
#prints the post id in console
 
ui console view
 
print(#my post id)
 
#deletes the post
 
 
delete wordpress post(#my post id)
 
delete wordpress post(#my post id)
 
</pre>
 
</pre>
  
This script will create a new public post with the title "My New Blog Post" and the content "This is the content of my new blog post." on your WordPress website. After the post is created, it will store the post's ID in the #my post id variable, print the post ID in the console, and then delete that post.
+
This script will create a new public post with the title "My New Blog Post" and the content "This is the content of my new blog post." on your WordPress website. After the post is created, it will store the post's ID in the #my post id variable, and then delete that post.
  
 
Remember to replace "https://yourwordpresssite.com", "username", and "password" with your WordPress site's URL, your username, and your password, respectively. Replace "My New Blog Post" and "This is the content of my new blog post." with your own title and content.
 
Remember to replace "https://yourwordpresssite.com", "username", and "password" with your WordPress site's URL, your username, and your password, respectively. Replace "My New Blog Post" and "This is the content of my new blog post." with your own title and content.

Latest revision as of 01:06, 4 July 2023

delete wordpress post command deletes a specified post or page from a WordPress website.

The post or page is specified by its ID. Make sure to correctly specify the ID, as this action is irreversible.

[edit] Parameters

Post ID: The ID of the post or page you want to delete.

[edit] Example

connect to wordpress("https://yourwordpresssite.com", "username", "password")
create wordpress post("My New Blog Post", "This is the content of my new blog post.", "public", "post", #my post id)
delete wordpress post(#my post id)

This script will create a new public post with the title "My New Blog Post" and the content "This is the content of my new blog post." on your WordPress website. After the post is created, it will store the post's ID in the #my post id variable, and then delete that post.

Remember to replace "https://yourwordpresssite.com", "username", and "password" with your WordPress site's URL, your username, and your password, respectively. Replace "My New Blog Post" and "This is the content of my new blog post." with your own title and content.

Personal tools
Namespaces

Variants
Actions
Navigation
Toolbox