Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [deleting]

The tag has no usage guidance.

1
vote
1answer
22 views

Can I differentiate between “Delete Post Permanently” and “Empty Trash” and do something for each accordingly?

I'm currently working on developing a plugin with a custom post type of "Dealer Location". (Not relevant to question, just a bit of background) When a post is in the trash and "delete permanently" is ...
0
votes
1answer
25 views

Problem with deleting a “Page”

My developer/designer is being a problem and won't tweek changes to my site... changes I can't do myself because I don't have FTP level ability (if that's the word?). I can only make basic changes ...
0
votes
1answer
33 views

Deleted categories still listed until additional page refresh

I've tried using wp_delete_category() and wp_delete_term() to delete a category, but after the page reloads, the deleted category still shows up in the results of get_categories(). But if I reload the ...
0
votes
1answer
19 views

Deleting my old Wordpress site. - issues

Im trying to delete my Wordpress site. I am the admin but every time I go to the dashboard, under settings there is no option to delete site just export and import. I want this site gone.
0
votes
0answers
19 views

How to prevent users from deleting their accounts?

I'd like to prevent user from deleting his/her account. This is mainly because of our internal rules requiring either two users being deleted at once or none at all. The only way to delete accounts ...
0
votes
1answer
18 views

delete_published_posts does not work

I made a plugin with a custom post type calls "product". For some reasons, the administrator cannot move to trash post inside the list table. I know the capability to do that is ...
0
votes
0answers
131 views

wp_delete_attachment doesn't delete image files / doesn't work

wp_delete_attachment should delete everything that is about attachment. However if I do wp_delete_attachment( (int)$delete_attachment_id, true ); The files remain on the server (even true should ...
0
votes
1answer
46 views

ajax delete value from custom field array

I have on my page a multi file upload that saves post attachments within a custom field --- if (!empty($_FILES['vidPix']['tmp_name'][0])) { $i = 1; $files = $...
1
vote
3answers
429 views

Clear cache on post of one type when something happens to post of other type

EDIT: Based on @TimHallman's answer I have a follow-up question, please see the bottom of this post. I am trying to do something that is way over my head and the more I think of it, the more ...
0
votes
1answer
39 views

Delete comments function

I've done a function that shows to the logged in user all her comments and gives her the possibility to delete them singularly through a delete button related to each comment printed. The function ...
-2
votes
1answer
38 views

why is the delete option missing from just one category?

A site I'm working on had one big category called News. I wanted to be a little more specific and create Industry News and Company News. Not a big deal at all, but when I go to delete News, I saw that ...
0
votes
1answer
202 views

Wordpress delete mysql rows with string

So I'm updating the code of an old wordpress plugin(never released), and I want the database to be "clean" before importing new data otherwise data will just add up and i want it clean before every ...
2
votes
1answer
257 views

Error after deleting Custom Post Type with a function (no trash used)

I'm using a function which I built to delete all posts from a user after a specific post is deleted. In my case I'm using a Custom Post Type called company. And additional Custom Post Types like jobs ...
0
votes
1answer
277 views

Delete a user from frontend

I'm developing a user management table, in which an user (I've already set restriction for for some specific roles) can create/edit or delete a user. How can I delete a user by clicking on delete link ...
0
votes
1answer
41 views

Auto delete posts based on content text

There are a bunch of posts which carry a line of same text. I am trying to figure out a way that will delete the whole post if it finds this text in its exact form. I haven't been successful in ...
1
vote
1answer
81 views

How can i limit the number of posts created per category?

How can I limit the number of posts created per category? And then delete the oldest post and save that one? I would like to do something like this: add_action("load-post-new.php","...
2
votes
3answers
945 views

Allow role to delete posts but block him the wp-admin

I have a custom user role : Photograph. This role should not be able to log into the back-office, but have to be able to delete their own posts from the front-end. I am using this code to block all ...
1
vote
0answers
1k views

Allow the comment author to delete their own comments

I've looked high and low and I can't find anything that will allow the logged in comment author to delete their own comment from the front end. All I want is a delete link under their comment that ...
4
votes
2answers
171 views

What would be a PHP command to erase all posts from category X from the last month?

I wish to run a cron job that would permanently erase all the posts belonging to some category from the past X days (say, week). This is probably very basic, but I would appreciate some pointers. ...
1
vote
2answers
313 views

Remove a menu sub-item

I want to remove a menu sub-item. But i cant'find the right item to delete. It is a plug caled "New User Approve". And the slug is :/wp-admin/users.php?page=new-user-approve-admin I don't want to ...
1
vote
1answer
253 views

Deleting Custom Post type data using mySQL command

I have around 2000 posts under a custom post type storelocations. Deleting them from WordPress admin takes a lot of time. How to delete all the posts from this custom post type from database using ...
3
votes
0answers
40 views

How to stop unlink images when remove a site or user

What's the best way to prevent images deleting?. I have a central cdn site to share images to several sites on wordpress multisite, and by mistake, I have remove a user from the network and all my ...
0
votes
2answers
182 views

get_delete_post_link() inside Loop stubbornly returns nothing

I've built a membership site where users can post listings from the frontend, edit those, and ideally also delete them. For the latter, I'd like to echo a "delete post" link to the frontend. The ...
1
vote
1answer
64 views

Function to delete a post, it's children and it's grand children (half way there already)

I've got a function working to delete a post and it's children. How can I amend this to delete it's grand children too? <?php function delete_post($sectionid) { global $post; $...
0
votes
0answers
574 views

Unable to delete images in Media Library

I have tons of images in my site. Now I'm trying to delete the broken images in the media library but it is not being deleted. Whenever I refresh the page, it is still there. How can I delete those ...
1
vote
1answer
479 views

Delete all children when parent is deleted - frontend

I have this function which I am using to enable front end page deleting which is working fine function delete_post(){ global $post; $deletepostlink= add_query_arg( 'frontend', 'true', ...
-2
votes
1answer
16 views

Uploaded Media Images on Site

If I delete uploaded images from my media file, will this delete them from the actual blogs?
0
votes
1answer
35 views

Clearing dummy data before launch

I have been developing my WordPress site on a development local server. I would now like to move the site to my production server. I don't need any of the dummy data that I have generated while ...
0
votes
1answer
43 views

I have tried using Plugins to remove 72K comments with no success

I have tried a lot of plugins that say they will remove all the comments with NO luck. I am still showing a number of 72,037 comments, but I no longer can see the actual comments themselves. And, it'...
2
votes
2answers
5k views

Problem : deletion failed, the theme requested does not exist

I had an awkward problem when i want to delete my theme, it gaves me this message: deletion failed, the theme requested does not exist wordpress. I can delete it from ftp manually but for client i ...
1
vote
2answers
321 views

How to delete user roles?

I installed BuddyPress which created additional user roles but even after deleting BuddyPress those roles are still there. How can I delete these roles? I have tried the remove_role() command but it ...
4
votes
1answer
35 views

Prevent Deletion of Blogs

I'm trying to prevent the deletion of blogs in a WordPress Multisite installation. There is already a plugin that does this, but it uses wp_die() as the solution, which in my scenario does not work. ...
0
votes
1answer
107 views

Delete post: 2 wp_redirect if pages are different

My website allows users to publish and manage posts from frontend. I've created a kind of account section where they have all their posts published which they can edit and delete. They can even delete ...
5
votes
1answer
64 views

Delete a specific category when deleting a user

I'm using the following function to create a portfolio category named "tips_username" when a user registers on my website. add_action('user_register', 'auto_create_traveltip_category'); function ...
0
votes
1answer
36 views

Delete all blogs on multisite

I'm writing a function that will delete all blogs (except the main one) from a multisite, the function is dieing whenever I call wpmu_delete_blog and I've got no idea why. $blogs = wp_get_sites( ...
0
votes
1answer
105 views

Why is this custom taxonomy showing in the database?

I have created a plugin that add geographic data to Wordpress. According to this answer the taxonomy data should not be stored in the database, however it seems to be stored: mysql> select * from ...
0
votes
1answer
1k views

Delete post image attachments with jQuery from the front end

In my WP 4.4 Twenty Sixteen child theme I want to delete post image attachments from a front end form created by a plugin. To achieve this I followed this answer, but the delete links doesn't delete ...
0
votes
3answers
97 views

What will happen if I delete all my attachment type posts from database?

OK maybe I'm a bit hysterical about performance, but I don't see any reason to have more than double the post entries I need in my database. I mean every image automatically creates an attachment ...
0
votes
1answer
364 views

Undeletable posts, users or other content

Recently I tried to move a WordPress instance to a production server and (besides other issues) had to deal with a page that could not be deleted via the admin panel. The success message would show up ...
0
votes
1answer
89 views

A delete/trash all function?

Is there a function (or a predefined set of functions) that will clear all posts, post tags and categories, all custom posts and custom post terms, attachments, menus and customizer settings? So far ...
0
votes
0answers
40 views

Hook To Get All Posts Deleted

I've added an which makes a call to an external service every time a post is deleted. However, it's on the delete_post hook, which works fine when I delete a single post, but if multiple posts are ...
1
vote
1answer
476 views

How to trigger function on theme delete?

Tried to find an or some hook to fire a function when theme is being delited, but didn't find any hook.. May be someone can tell if there's a way to fire my function on themes delete event? I need ...
0
votes
0answers
101 views

Delete custom fields on post publish?

I have some custom fields, for example one is named "thumb". Custom field is generated automatically by some plugin. I do not use it at all. Is there any function which will delete that custom field ...
16
votes
1answer
1k views

Is there a action hook for the “Empty Trash” button?

I would like to run a function when the user clicks the "Empty Trash" button for posts. Something like: add_action('empty_trash','myFunction'); function myFunction(){ // My code }
1
vote
1answer
1k views

Delete Associated Media Upon Page / Post Deletion

I found this code. But not work for me. Where to insert the code? I try wp-content/theme/mytheme/functions.php - not work. wp-includes/post.php - not work. wp-includes/functions.php - not work. ...
0
votes
2answers
900 views

Bulk delete users from a csv list

I have a WordPress site with 65,000 registered users, about 10,000 of those users are spam bots, inactive account, hard email bonces etc. I have them gathered in a CSV list, how can I use that csv ...
8
votes
1answer
1k views

Automatically delete inactive users after 2 months

I am trying to modify this function: // automatically delete users after 7 days in wordpress function wcs_auto_delete_users() { global $wpdb; $query = $wpdb->prepare( "SELECT ID FROM $wpdb->...
0
votes
0answers
1k views

Get id from database

I need this ID to delete users from table. My plugin crate new table in DB when he is activate. All this code is in main.php, and in second.php i have only form that display my results.. and i include ...
0
votes
1answer
83 views

Which delete query is better with prepare or delete

Just wondering which of the two delete queries would be the preffered method $qdel = $wpdb->query($wpdb->prepare("DELETE FROM $shopping_meta_table WHERE meta_shopping_key = '%s' AND wp_user_id =...
1
vote
2answers
731 views

How to mass-delete inline styles in Wordpress custom post type automatically?

I'm looking for a pragmatic way to delete about 100+ individual pages worth of inline styles. I had entered in content for a client by copying and pasting from Word, which took all that data with it ...