You can remove the capabilites delete_pages
, delete_others_pages
and delete_published_pages
from the role which the user is assigned to. This will prevent the complete user role from deleting pages.
To restrict this behavior only to one user, you have to create and assign a dedicated, new role to the user. Look at the Members plugin from Justin Tadlock for more information.
Example: Remove the ability to delete pages from admin role
$role = get_role('administrator');
$role->remove_cap('delete_pages');
$role->remove_cap('delete_others_pages');
$role->remove_cap('delete_published_pages');
More resources
Related Posts:
- get_pages() not ordering as it should
- Editing the Number at the end of Page URLs / Editing Page Slugs
- Pagination Help on Crazy Custom Authors Page
- Create subpage /user/ or /my-profile/ like /author/ with additional query like /user/user123
- Hide page title in WordPress 3.0
- Selecting An image from the Media LIbrary on the frontend
- Custom protected password page with ACF
- Page load requires a trailing “/” [closed]
- Virtual Pages plugins
- Programmatically add a custom page/path/url/route to WordPress
- What is the most idiomatic way to let clients edit phrases in HTML?
- How to merge all my pages into one, while keeping a menu bar?
- How to change URL Custom Page?
- redirect product-category to a custom page
- custom headers for static home page and posts page
- Show posts on a page based on a category and tag(s)
- Split Conference WordPress Page in different years
- Add google org chart to wordpress page
- How to get custom page template being edited in gutenberg editor
- Control Content On Non-Blog Pages
- custom meta box for page default template
- Best practice – pages – ACF or inline coding
- How to hook up search results page to a back-end page?
- How to structure model showcase
- How to customize
- Add a searchbox to the body of a page
- Create page as a file in my theme?
- Featured Image If Else Condition
- Insert menu with a custom walker into page / post body using shortcode?
- How to create “custom page types” with different custom fields in them?
- How to create custom search page
- Creating php pages in wordpress and assigning them to wordpress pages
- How to display page ids as page slug names?
- How to create custom layouts and static pages in themes for clients
- How to make the Pages in WordPress Customized?
- Creating custom page template
- Change Site Logo or Menu Logo Per Page
- change top banner content on specific page
- How to add page content into another page
- Display a specified content on a Page and all its child pages
- Use a custom page with dynamic content as a user profile page
- I want to embed mystream video in my wordpress site
- Swap home page based on user role, Elementor layout breaking
- Taxonomy template is not reading
- New Page/Post Screen Opens an Existing Post
- Static Page, need Last and Next links at the bottom
- How can I create a Custom Page? (not a page template!!)
- wordpress custom posts page not showing
- How to serve an already coded html page in a WP page, to assign a simpler url
- Admin menu disable new/delete page
- Show different pages on site depending on user choice
- WordPress post submit page
- Redirect Every Instance of The Author Template Pages to Custom Author Pages
- Allow arbitrary text after page URL
- Best way to create a page outside of the pages list
- Want home page to click through to two different page types
- Custom single page based on which custom page template is selected
- How to duplicate “Pages” section in the control panel?
- Page template with custom html fields inside a content
- Pass query param to custom page
- Is there a way to have information on one page automatically feed into another? [closed]
- how to add a page
- How to apply styles to the custom page template
- How can I make a search term redirect to a page
- Custom CSS working on home page but not on NEW created PAGE
- Create a page for each database table entries
- Why do I get the timeout warning?
- Using single.php from plugin folder instead of default template folder
- Custom CSS for full post vs. excerpt (Content Options)
- Add field to posts (checkbox) that only one post can have
- Reproducing hierarchical list output from wp_list_categories(), using get_categories()
- How do I go straight to “Edit More Details” when clicking on an item in the media library?
- How can I add a button to quicktags-toolbar?
- Where to add one custom end point and its function?
- Private member page
- How to add custom control to a page?
- Navigation label for page in custom theme
- Auto login from custom registration form
- How to get Related Custom Posts?
- Background image not appearing
- custom upload directory only for plugin uploads
- Is it possible to change the structure of the HTML generated by the_content()? If yes, how? If not, is there a workaround?
- Is it advisable to use `add_rewrite_rule()` to serve a custom page?
- Customizing the Widget content markup
- What is the best way to modify Admin Panel on WordPress?
- How to remove Customizer’s Section and move Control straight to Panel using Child Theme
- How to add custom meta box when you have a custom page template file
- How to publish some default pages in Multisite creation?
- Customizing admin look and feel for just one particular type of user
- 2.9 to 3.0: Pros and cons of upgrading?
- query_posts meta_key with current date
- Get custom field value from not-current page
- RSS feed showing deleted post
- Woocommerce – Remove cart button depending product (post) status
- Login CSS style doesn’t load instantly
- How do I display entries in the top menu based on conditions selected in the sidebar menu?
- Customizer API and pages
- Editing a theme’s templates
- How to delete orphan userdata from array in wp-options
- Twenty Eleven theme, how to change style to a specific “format”