wp_die()
See the codex for full usage details:
https://codex.wordpress.org/Function_Reference/wp_die
You can even include html in the message field if you want to.
Related Posts:
- Cannot access non-wordpress subdirectories as wordpress overrides them with a 404 error
- WordPress Migration: Getting 404 Errors: Only Home Page works
- How to eliminate weird 404 errors in wp-admin?
- Setting 404 page in Nginx
- External page integrated into WordPress returns a 404 error
- WordPress Theme’s 404.php not found, server defaults to Apache’s own 404 page
- get_the_ID() gives notice in 404 page
- Error 404 Page Not Found When Updating a Post or Page
- How to open the 404 page in the Theme Customizer preview?
- Feed 404 Errors
- 404 when fetching image from wp-content/uploads/
- REST API: No route was found matching the URL and request method
- How to fix strange 500 Error after Editing Menu?
- WordPress REST API 404
- wp_remote_get() not retrieving pages properly
- Changing Site Address (URL) causes 404
- Detect 404 before headers are sent
- Unwanted redirect in admin area
- In wordpress I am manipulation 404 response. I want to give the response before 404 error is given to google
- 404 error on homepage when using Nginx proxying to Apache
- Non “WordPress” pages/code getting 404 error
- 404 error on all pages but homepage
- Why am I sometimes getting a 404 error when I try to update a page with Elementor?
- Where is the best part to hijack or catch a potential 404
- page not found in Chrome, but found in Firefox
- Why does my WordPress show a 404 message for 403 forbidden directories?
- Moved to new server, all pages work EXCEPT home page (page not found)
- High CPU usage on 404 errors
- How to fix “failed to set referrer policy: The value ‘ ‘ is not one of…”?
- “Lost password” page triggers 404
- 404 to 301 – Fixing old links
- How do I bypass WordPress 404 handling?
- $error = 404 after caught add_rewrite_rule
- How do I go about fixing this apparently messed up upgrade?
- PHP Notice error (when on 404 page)
- WordPress Stats keeps showing non-existent post as a top post?
- WP Rest API not working
- : Failed to load resource
- What does do_action(‘admin_init’); does actually?
- Form in WordPress : 404
- Why is my Javascript console showing a 404 error for a file called “null” on a clean WordPress install?
- Why Runtime service worker (runtime-service-worker.js) is being loaded, but can’t be found?
- Non-existent page returns code 200
- WP is redirecting instead of going to 404
- Getting a 404 error when clicking edit page
- Only on 404 page, get notice: trying to get property of non-object on nonce
- Conditional for 404 page not work
- Nginx with WordPress not showing template 404 for certain file types
- post parameter ‘name’ 404 error
- Is there a way to avoid 404 pages in WordPress?
- Intermittently missing pages and posts in WordPress
- Getting a 404 in Debugger for example.com/wp-admin/Array?
- oEmbed 404 errors when trying to use embed block
- Intercept 404 and try to serve another content if exists?
- 404 after moving localhost wp to server
- Intermittent 404 errors, rewrite rules, and BBPress
- WordPress takes too long to show 404 error on images (on LEMP stack)
- Page not found error when adding text `2 = 2 ^ 1` to the page
- WordPress Post – On Post – 404 Page Not Found
- How to find out which function is causing a 404
- Template redirect template loaded, but the header 404
- Prevent WordPress from interpreting a subfolder?
- Getting 404s on New Pages
- How can I send an email in my plugin?
- All pages after level 1 showing 404 after WordPress migration plugin – how to fix?
- index2.php in root causing 404 error
- Why I get File Not Found (404 error) when the file is actual there?
- Created php page in wordpress – Error Page can not be reached
- WP_DEBUG must be on, otherwise edit post or page will show 404 error
- Trouble with CPT Child 404
- Getting “404 page not found” error when i access to my Login page
- Virtual robots.txt missing
- Moved from Blogger to WordPress, however I can only see the Google 404 page
- Homepage Not Found Error [closed]
- Custom 404 page for dashboard
- My Homepage Suddenly Disappeared and I Can’t Get It Back
- wp-tinymce.php 404
- WordPress.org support topics returning 404 [closed]
- Display child pages on parent page: 404 message overrules shortcode in page
- Permalink Doesnt Work – URL Not Found
- Using a custom 410 page
- How can I prevent non-existing wordpress pages from getting redirected to home page
- Incorrect url for sharing blog on linkedin [closed]
- Catch 404 errors in nested installations
- Getting 404 error on my wp rewrite error
- WordPress 404 Page displaying on a sub directory that has it’s own 404 page
- redirect deleted / drafted pages
- 404 error on dynamic stylesheet creation
- Why do I have a weird rendering issue only on 404.php caused by wp_nav_menu?
- make wordpress log errors in apache log file
- How to fix: “The resource you are looking for has been removed, had its name changed, or is temporarily unavailable.”
- Page not found (404 Error) even if the page exists?
- WordPress refuses to read the .htaccess file and gives a 404 for sub-pages
- How to recover WordPress Adress(URL)
- Custom JSON feed rewrite
- My wordpress website does not show 404 page and results in http 500 error
- Console Browser says it cannot find a requested image that does not exist on my Website [closed]
- wp-json Returns 404 Upon Plugin Activation
- Page not found – Wamp green, phpmyadmin working
- WordPress 404 errors for old plugin files via Google Bot