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]
- Show the author only own types of publications. (JetEngine, Elementor)
- submit posts by unregistered users in wordpress
- Calendar Solution: Handling upcoming Dates with Posts?
- get_post_type on post.php
- Is there an easy way to flag posts in the admin area?
- finding whether request is for post, and post id
- Anonymous Postings
- Any built-in function to associate a post to category through a plugin?
- Filter custom posts based on the user role of author
- How to hide some section in WordPress under Post
- Redirection of users away from wp-admin (but not administrators)
- Display post lists in 2nd paragraph
- Can’t delete Draft Post [closed]
- Matching Chapters to a Custom posts [closed]
- 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]
- Custom post type – no layout section of Document tab, and no author choice
- WordPress display breadcrumbs using Yoast plugin [closed]
- Outbound link autometic converted into linkdirect , and not opening
- Display by Category in Admin
- Plugin updates change folder permissions
- Preg Match All doesn’t Allow echo first character for WordPress Taxonomy Tags
- Two problems on my WordPress installation [closed]
- Linux Permissions and Ownership for WordPress
- posts comments goes to trash
- Contributive page where people logged in can write
- WooCommerce specifc variations for specific user role [closed]
- Excerpts on category page
- How to pull email and name from Flamingo plugin
- How to create restrict content to users (by user, not by role)
- How to set add question capability for author role in wp pro quiz plugin
- Which widget to use for display category post with view more? [closed]
- External RSS feed to WordPress Portfolio
- Trying to fix form resubmition with PRG (Getting error: Cannot modify header information – headers already sent by)
- How to create user that has permission to create new sites on WordPress with multisite option enabled?
- Updating plugins asks for FTP information, why? (this is a new one)
- Display wordpress post’s in popup?
- Lock access to plugin options
- Unable to add TAB character to post?
- how to add text to posts from tags
- Can a Plugin Override New User Default Role Type
- Can’t Install Standard Plugins on a Local MAMP installation
- Can I allow certain people to add/edit pages within a parent?
- Add category selection to custom post type (plugin)
- Add menu page issues (permissions & position)
- Redirect to another page using contact form 7? [closed]
- Would Gutenberg be considered a PlugIn?
- pagination on data fetched using SQL query
- How to delete all trashed item in one-go
- AJAX fileupload – TypeError: not a function ajaxSubmit()
- Advanced Custom Fields – Disable Users to Edit Custom Fields
- can i limit editing specific custom fields to certain roles?
- How to get the first post and second post in a wordpress blog?
- Is it possible to send blog posts via email to subscribers?
- Custom setup of wordpress comments that are displayed
- Is there any plugin which can paste a common content to my every post?
- Recent posts per category loop?
- ‘Organize Series Plugin’ as muti author feature
- Add user role to generated plugin
- Import Instagram post to WordPress blog post
- Multisite – maximum number of users with specific role
- Problem of encoding characters (apostrophes) in my posts publications
- How to backup single post in wordpress [closed]
- Why is the ‘Gutenberg’ Plugin generating an ‘Inconsistent File Permissions’ error when other Plugins, with the same permissions, do not?
- Understanding State in WordPress Multisites
- Allow only Admin role to access plugin settings/options page
- How to get all posts belongs to a user between a certain date
- How to allow Contributors to publish articles after approval
- How do I publish portfolio items with a future date?
- wordpress content .php file in an iframe’s src in a wordpress post
- WordPress as template engine
- Making my plugin create a page?
- Is there a way to make the main page only display a brief description of the full article?
- How to change the post form from plugin?
- WordPress plugin Post Creation [closed]
- WordPress Book Exchange Plugin Equivalent?
- Don’t publish/update a post when a plugin finds errors in custom fields
- Allowing users to Sign-up > Login > Post articles that need approval
- What are the correct permissions so WP doesn’t ask for FTP credentials if installing plugin?
- Custom shortcode for displaying user based on a role parameter
- How I can change the required capability for an admin menu without editing the plugin file?
- How can I automatically download all images from all imported posts, place them on my new host, and replace all the links
- Add User Role: Pre-saved in User-Meta [SOLVED]
- posts from multiple post types in one slider
- WordPress won’t allow for updates to plugins or WordPress Core
- How to display the featured post on the category page?
- Set Multiple Meta Values as an Array Using dispatch( ‘core/editor’ ).editPost() Call in Gutenberg/JS
- Flickering sidebar when scrolling page [closed]
- Is there a plugin or a way in the wordpress that would let us have different versions of a post or page accessibe to users?