Using a page template without a page

What I would advice, and have done myself when making WordPress sites for clients.
Create a custom post type that they can’t get access to. You can achieve this by conditionally removing the post type from the admin sidebar.
One of the ways to solve that problem is to add a custom capability to the user(s) that you would like to allow editing these critical pages, lets call the capability “edit_ciritical_page”
Then in your function.php/file included from function.php/plugin file you say

if (!current_user_can("edit_ciritcal_page") {
    remove_menu_page('edit.php?post_type=critical_post_type');
}

If you don’t what to add the custom capability, you could also just check it based on the username/user email.

Leave a Comment