Don’t let the action die, just do a redirect (to wherever you’d like):
function wpse_92155_before_delete_post() {
wp_redirect(admin_url('edit.php'));
exit();
} // function wpse_92155_before_delete_post
add_action('before_delete_post', 'wpse_92155_before_delete_post', 1);
Related Posts:
- Limit access to posts/pages by user roles
- Enable comments for post with comments meta box removed
- WordPress roles – Protect administrator role
- Advanced Custom Fields/User Role Editor – how to hide ACF for certain users?
- How create a role with admin capability less 1 or 2?
- Using the “Latest posts” feature on a different site
- How to allow an editor to edit all WordPress blog posts but have the last say as administrator?
- Is there any way to make myself an admin?
- How to hide plugin options for editors via functions.php
- See which user role / capability is needed to use a plugin
- Different email notifications (about pending posts) to different users
- How to give access to the particular page in wordpress for specific username/email NOT roles [closed]
- Is there a way (plugin?) to restrict a user to being able to edit just one page?
- How can I make it so the Add New Post page has Visibility set to Private by default?
- Deactivate plugin for a specific user group
- Can’t install new plugins because of the error “Could not create directory”
- How to moderate posts
- How to add option box in “Edit Post” plugin API?
- Delete Post With No Traffic?
- Automatically Creating Posts for Popular Forum Topics or Products [closed]
- Let readers suggest edits from the frontend
- Allowing Custom Capability to Manage Plugin Options
- Disable plugins for a specific user role
- How does WordPress update plugins, without running into permissions issues?
- Auto-post to multiple sites like Posterous? [closed]
- Plugins won’t auto-update on IIS
- Article source link for posts
- Remove Posts Quick Edit link for specific user role? WP 3.3
- Is there a plugin to display certain posts on certain pages? [closed]
- Custom Post Type causes Page Not Found
- 403 Forbidden – You don’t have permission to access /wp-admin/admin-ajax.php on this server
- Could not create directory
- Keep user’s privileges on accessing contents in JSON response
- Get the url of the full sized attachment image using post ID?
- Adding Attachment Display Settings in custom media frame
- Set user ID at time of wp_create_user
- Output HTML only on individual post view
- Getting user roles in plugin files
- Portfolio + Blog: multisite or plugin?
- Prevent WordPress installing plugins and themes via Admin
- How to enable qTranslate languages tabs in custom plugin page
- Redirection of users away from wp-admin (but not administrators)
- WordPress comments not appearing in blog posts, likely because of Redux template. Could I fix this with a plugin that adds a comment form as a block? [closed]
- posts comments goes to trash
- Add category selection to custom post type (plugin)
- Import Instagram post to WordPress blog post
- Why is the ‘Gutenberg’ Plugin generating an ‘Inconsistent File Permissions’ error when other Plugins, with the same permissions, do not?
- How to get all posts belongs to a user between a certain date
- How to allow Contributors to publish articles after approval
- wordpress content .php file in an iframe’s src in a wordpress post
- Making my plugin create a page?
- WordPress Book Exchange Plugin Equivalent?
- Multiple authors and readers restricted by role [closed]
- Custom Login page with custom redirects for each user?
- Function added to hook “new_to_publish” not executing – custom plugin
- Creating an admin meta box to save post as pending
- Mutliple users editing single document in wordspress
- Getting a list of the published posts
- Custom Template for wordpress cpt plugin
- How can i summerize posts or news automatically in word press site?
- Help to Create a Simple Plugin to make a post
- Is there a hook similar to “save_post” which only fires AFTER the post is completely published?
- Show post object of any page in frontend
- Trying to add a new feature in my wordpress website
- Powerpress upload a podcast without creating a post for it
- automatically set random featured image by category in wordpress on post
- add tags to wordpress post using REST API
- How to Create a Learning Management Plugin in WordPress to Manage Courses [LMS]
- Allow a page to be edited by a specific custom role
- Prefix WordPress Taxonomy Tags With Hashtag Symbol Like Twitter
- How to create different views for different user roles?
- How to make a page both “private” and “password protected”
- How can I disable access to plugin settings in wp admin for other roles
- Remove dashboard links from wordpress
- How can I get the Post ID and Post Type within a Must Use Plugin?
- allow editor/author to publish others posts but not publish their own
- Why user profile update creates Additional Capabilities
- Get content and send to 3rd party
- Is it possible to get a shortcode generated by a plugin, then, using a function, create a new post using that shortcode?
- SSH vs WordPress
- WordPress Dashboard organize posts based on categories
- Add new post using a page inside the website
- Custom post type request switches to media request
- Related posts popup
- Find And Add Category to Posts
- Get page type to display content
- Insert data in custom table during new post creation
- Capturing POST data
- Most visited posts
- Get a submitted value from front end post form for single template
- Problem with permissions in wp-content/plugins
- Making plugin to use different table prefix cause permission problem
- Automatically set posts to NoIndex depending on category?
- Notification When Post Approved
- Automatically put a menu on every post
- Windows 10 Printer that Sends to WordPress [closed]
- How to give different user access to different people?
- hide particular category post from front page only [closed]
- registration plugin [closed]
- My Blog page ( posts page ) theme isn’t changing with the new theme [closed]