Articles of deleted

Downgrade user from role that allows post creation

I am an admin of a multi-author blog. I am implementing a monitoring system which will require me to downgrade a user from an ‘author’ (this role allows them to make a custom post) back to the ‘reader’ role if I think it is a spam account, or if they are breaking website rules. After […]

How to check what plugins used to be on a WordPress installation?

It’s easy to see what plugins are currently disabled through /wp-admin — but how could I see what plugins used to be on an installation of WordPress and were deleted?

Delete all custom fields at once?

I have about 50 custom fields I need to delete at once, going through each one and deleting one at a time would take too long because it takes about 4 seconds for a page to load and I just don’t have time to do that. I need to delete them because I previously used […]

WordPress Delete hook with wp_delete_post function?

I have this action/hook: add_action( ‘before_delete_post’, ‘my_delete_function’ ); function my_delete_function($post_id) { global $wpdb; $achievement = get_the_category($post_id); $h = $achievement[0]->cat_ID; $s = ”.str_replace(‘”‘, ”, $h); if ( $s == 6 || $s == 5){ $wpdb->query(“DELETE FROM wp_votes WHERE post = “.$post_id) or die(mysql_error()); } } The above works great when I am deleting posts from the […]

Get post id in wordpress action?

I have this code add_action( ‘delete_post’, ‘my_delete_function’ ); function my_delete_function() { global $wpdb; $wpdb->query(” DELETE FROM wp_votes WHERE post=”.$thePostID.” ;); } How can I get the id of the post being deleted? Additionally, will this still work if multiple posts are deleted in the admin?

Remove the deleted users avatar from list

Problem Hi everyone, I have a bit of a problem. I have a function that outputs the avatars of users that follow me . It works great, but if the user is deleted the avatars remain visible as a blank image box with a broken hyperlink missing the users username. Is there any way to […]

Find out who deleted a page or post?

Someone moved a very important page on my website into the trash, and I do not know who did it! It was not deleted permanently so I don’t need to worry, in that sense. The revisions, when I restored it, show that someone edited it 3 days prior to today, so it could have been […]

How to restore deleted pages/posts?

I recently deleted some pages in my wordpress site. Now I want to re-store them. How can I do this? Any suggestions will be appreciated. Thanks in advance

How to hook a function only when I need to delete permanently a post?

I need to hook a function only when I delete permanently a post from the database, I’ve tried the ‘before_delete_post’ hook, however, it’s called both when it’s trashed and permanently deleted. The wp_delete_post() function calls wp_trash_post() and should stop processing, but it looks like the wp_delete_post() is called again after the post is trashed. I’ve […]

Upgraded from 2.8.x to 3.3.1 and lost content

First of all I did a manual upgrade of the wordpress site. I did everything by the book. I disabled all plugins, did all the backups. I upgraded to the new version, everything went fine. Only that I lost all content. I switched from my custom themes to default one (Twenty Eleven 1.3) still my […]