Questions tagged [wp-delete-post]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
-1
votes
1answer
16 views

How to Delete Posts by title?

I have about 2000 titles. How can I automatically delete posts with these titles? For example
0
votes
1answer
15 views

`wp_delete_post` returns NULL

I am trying to delete a lot of WordPress posts programmatically using wp_delete_post, but not all posts are deleted successfully. In some cases I get NULL as a return value for wp_delete_post($row->...
0
votes
1answer
16 views

Auto delete pages/posts without views

Hello please does anyone know a way to automatically delete posts that doesn't get views within a period of time. Lets say if a post on my site is made and within 30 days, there are no views on the ...
0
votes
1answer
26 views

$wpdb->delete not working for me

I have a function (see in full below) that syncs data into WP from an external database. It's a list of scheduled items. When the schedule is updated, old data should be deleted. See this snippet: $...
0
votes
1answer
18 views

How to delete a post and keep its slug to refer to another post

I've 2 almost identical posts: https://webscraping.pro/reliable-open-proxies-for-business-directories-scrape/ https://webscraping.pro/reliable-rotating-proxies-for-business-directories-scrape/ I ...
0
votes
1answer
76 views

Filter DELETE REST API calls

I have a custom post type, that can be editable by more than one user. Each post of that type has a field with the user ids who can edit it (kinda like co-authors). But since many users have ...
0
votes
2answers
57 views

After creating Custom post type by user delete old one

I have created a form where users update their profile. When a profile is created or updated it creates a CPT called course. The url is the permalink + /course/ + the title of the course /* CREATING ...
0
votes
1answer
39 views

Let any visitors delete a post if they know Id nr & password?

I've got only one function left that I need to solve (if it's solvable). I've got a frontend post system for unregistered users. But there are no way for the users to delete a post if they later want....
4
votes
1answer
252 views

How to update the delete user confirmation form?

I want to update the confirmation form for delete user. If user has posts, it shows Attribute all content to - option to reassign other author for his posts. It takes lots-of time to load the page, if ...
0
votes
0answers
20 views

How to remove a page in its entirety

I'm having a problem with an unwanted page not disappearing, and continuing to be referenced even when replaced with another page. Here's the situation. I have 2 pages with different versions of the ...
0
votes
0answers
206 views

How to optimize wp_delete_post() function, or why it is so slow

I have a code block to delete all the products from a store. This products have several custom fields and some images attached. The code is below: set_time_limit(0); define('WP_USE_THEMES', false); ...
2
votes
2answers
1k views

Before Delete Post

I am trying to update the value of one custom post type's meta when another custom post type is deleted. When a space_rental is deleted, I need to update some meta value on a space. I don't think I ...