According to the Template Page hierarchy, https://developer.wordpress.org/files/2014/10/wp-hierarchy.png the only template page WP will load is 404.php
But, you might try this in your mu-plugins:
//Some function to check database to see if this URL should exist
if ( ! checkIfPageExists( $_SERVER['REQUEST_URI'] ) ) {
//Set 404 Status
status_header( "404" );
get_header();
//do your custom 404 code here
get_footer();
}
I’m not sure it’ll work, but give it a try
Related Posts:
- Selectively update themes in WordPress multisite
- How to change title tag at page after loaded post?
- Following WordPress Markup Is mandatory, got awkward resultyby wordpress standard markup?
- How do I create plugin or theme using MVC pattern?
- How to limit number of number of categories displayed by categories widget
- PowerPress mobile media player
- When is the proper time to minify css and js with git workflow?
- Strange Situation When Try To Retrieve Github Gist Using wp_remote_get
- How to hide or rename “X” and “x-child” references in website source?
- WordPress custom taxonomy check box to dropdown
- How to Get Current Custom Post Type Associated Taxonomy Term
- Plugin templates vs Parent Theme
- Widget HTML Display Problem
- Problem with context in multisite – getting main site data in every blog (get_pages())
- How to create a backend for a custom theme?
- wp_nonce_field displaying twice
- how to invoke wordpress API from other existing PHP system
- Redirect to another page using contact form 7? [closed]
- Warning: include(): https:// wrapper is disabled in the server configuration by allow_url_include=0
- WP Multisite login not working on one subsite. Possibly cookies/ history issue?
- Plugin is not generating title tags on any pages or posts
- Is it necessary to do validation again when retrieving data from database?
- How to Control CSS of Admin On Creating only a Specific Custom Post Type
- Can’t change the style of a submit input type? [closed]
- Make a plugin page out of influence of the theme’s style
- Update Data parameter of a wp_localize_script() call
- Custom entity search and display
- register_activation_hook on multisite
- WP Plugin Running before jQuery
- Template directory in plugin
- get_the_tags with separator control?
- How to only load css for used blocks on frontend
- 400 Bad Request, in wordpress theme development, wp_ajax
- Add child pages to submenu automatically
- Why in this archive page that call query_posts() function show only the last 10 posts?
- my own SVN for a plugin/theme
- Issue on Setting $icon_url Parameter on WP add_menu_page()
- Why enqueue styles on hook?
- Getting a WordPress Debug Strategy
- unable to wp_enqueue_script(‘suggest’);
- Drawing the line between theme & plugin on large scale bespoke projects
- WordPress multisite,use same cookies across all website?
- Apply styles to blockquote element with the WYSIWYG editor
- PHP File_exist() not working – Checking if File Exist in WordPress Theme Directory
- Why would you use esc_attr() on internal functions?
- Invalid hook call on save, not edit when using swiper slider
- Proper way to use useSelect
- Conditional Generation of Image Sizes using add_image_size
- How to add plugin options in wp editor page
- WP: Search and replace in DB programmatically
- Ajax: Populate with content from a post’s ID not working – duplicating current page html instead
- How to find where an object first instantiatiation
- Gutenberg blocks error: Each child in a list should have a unique “key” prop
- Full documentation about $args for register_rest_route?
- WP Still Generating 150×150 Thumbnail Size Even After Un-Setting Small Size in Functions.php
- modify show UI of a registered taxonomy
- Using function from enqueued .js file in theme in plugin?
- How to get current logged-in user details in multisite?
- Does WordPress default CSS have Grids?
- Using HTML links within translatable string
- How to resize WordPress images on upload to specific height and width without cropping it
- add_action wp_ajax_ not loading in plugin file WP Network
- Create fixed static pages
- How to get terms for taxonomy
- Clean way to initialize plugin in newly-added site when plugin has been network activated?
- How to replace settings in WordPress plugin from a theme
- Save temporary registration data
- How to remove/replace current page template?
- WordPress dynamic widget by location?
- How to share user data across multiple WordPress websites?
- Is there anything special required to make a plugin work in a multisite environment?
- WordPress Page Reload Takes forever during theme development
- How to edit wp-signup.php content using plugin
- Adjust query on single
- Setting a post’s category
- rewrite_rules problem
- Using password protection to load different page elements?
- Anyone using unzip_file successfully? It uploads the zip but doesn’t extract it!
- How can the_excerpt (or equivalent) be called on a category description?
- Why does website stretch and white space on load? [duplicate]
- Change the behaviour of a button
- WP_Query order posts by category
- Configuring Xdebug with docker compose
- Why my theme’s css not working on another site
- How to access index file in Block Themes?
- How to show comments from different Plugins to same post type?
- Pass custom props to
- Include external po file for 3th party plugin to theme
- WordPress Favicon not Working For Images/Videos/PDFs
- How to make premium plugin? I want to limit it until verification
- Google Web Core Vitals – management, how to in wordpress and advice
- How to add quick edit on the list of users to edit custom fields?
- Impossible to declare box-shadow with wp.customize?
- Want to know how to reveal a WordPress theme, considering the theme name is hidden?
- Override category archive page title (not the head title)
- How do I add filter with woocommerce categories?
- Can’t upload image via submitting custom post from frontend
- Need Help to make a logic for editing posts in Frontend
- Redirection from a specific page for users logged in but not with membership
- How can we stop showing short code in create or edit post section