Plugin as custom page
If your plugin have to completely control the output of the page, i.e. not taking into account the active theme or other installed plugins, than you can simply prevent WordPress handle that url. For example: add_action(‘init’, function() { if (trim(add_query_arg(array()), “https://wordpress.stackexchange.com/”) === ‘book-search’) { require_once plugin_dir_path( __FILE__ ) . “pages/book-search.php”; exit(); } }); add_query_arg() is … Read more