Title: Trigger 404
Last modified: August 19, 2016

---

# Trigger 404

 *  Resolved [Micha? Ochman](https://wordpress.org/support/users/michoch/)
 * (@michoch)
 * [15 years, 8 months ago](https://wordpress.org/support/topic/trigger-404/)
 * Hi,
 * is there a way to trigger the 404 error, so the is_404() will return true?

Viewing 2 replies - 1 through 2 (of 2 total)

 *  [Dave Redfern](https://wordpress.org/support/users/daveredfern/)
 * (@daveredfern)
 * [15 years, 8 months ago](https://wordpress.org/support/topic/trigger-404/#post-1663086)
 * Hello,
 * Can’t this just be triggered by visiting a random URL on your website which doesn’t
   exist?
 * Dave.
 *  Thread Starter [Micha? Ochman](https://wordpress.org/support/users/michoch/)
 * (@michoch)
 * [15 years, 8 months ago](https://wordpress.org/support/topic/trigger-404/#post-1663111)
 * No, I don’t want to trigger it myself, I want to trigger it from the theme or
   plugin files. wp_redirect() to inexisting random URL is also not an option.
 * EDIT:
    ok, I found it in the source code.
 * eg.:
    global $wp_query; $wp_query->set_404();

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Trigger 404’ is closed to new replies.

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 2 replies
 * 2 participants
 * Last reply from: [Micha? Ochman](https://wordpress.org/support/users/michoch/)
 * Last activity: [15 years, 8 months ago](https://wordpress.org/support/topic/trigger-404/#post-1663111)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
