一种简单的方法是创建一个Must Use Plugin 并在连接到action, 喜欢wp_loaded
function wpd_check_page_exists(){
    $page = get_page_by_title( \'The Page\' );
    if( !$page ){
        wp_mail( \'you@example.com\', \'a message from your site\', \'the page is gone!\' );
    }
}
add_action( \'wp_loaded\', \'wpd_check_page_exists\' );
 您可能希望使用不同的函数来查询页面,这取决于您如何识别页面是否存在,如
get_post 如果要传递ID,或
get_page_by_path, 或
WP_Query.