Viewing 2 replies - 1 through 2 (of 2 total)
  • Hello,

    Can’t this just be triggered by visiting a random URL on your website which doesn’t exist?

    Dave.

    Thread Starter Micha? Ochman

    (@michoch)

    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.