# SOLVED: Can't see the 404 template

**URL:** <https://forum.bricksbuilder.io/t/solved-cant-see-the-404-template/9609>\
**Category:** Bugs\
**Created:** [January 27, 2023, 1:58am UTC](https://forum.bricksbuilder.io/t/solved-cant-see-the-404-template/9609 "2023-01-27T01:58:14Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![zippa71](https://forum.bricksbuilder.io/letter_avatar_proxy/v4/letter/z/7ba0ec/32.png) [@zippa71](https://forum.bricksbuilder.io/u/zippa71)\
**Post date:** [January 27, 2023, 1:58am UTC](https://forum.bricksbuilder.io/t/solved-cant-see-the-404-template/9609/1 "2023-01-27T01:58:14Z")

</div>

I had a post about how to make certain page output conditions?

> [@Separate conditions for templates](https://forum.bricksbuilder.io/t/separate-conditions-for-templates/9563):
>
> Good people, help. I had to do the following, so that the post type “product” created by the author and having the custom status “approved” could be seen only by the author of this post and the administrator. For everyone else, a 404 page should be given. I’m struggling with the code, it doesn’t work hot_face

I never got a response, but I did it anyway.

```auto
add_action( 'template_redirect', 'my_404event', 1 );
function my_404event() {
    global $post, $wp_query;
    if ( is_singular( 'product' ) && get_post_status( $post )=='approved' && $post->post_author != get_current_user_id()) {
        $wp_query->set_404();
        status_header(404);
        include( get_query_template( '404' ) );
      // include( get_404_template());
        exit;
    }
}

```

Displays the regular template 404 Bricks  
And everything would be fine if not for one BUT … does not see the 404 template

---

<div class="post-metadata">

**Author:** ![zippa71](https://forum.bricksbuilder.io/letter_avatar_proxy/v4/letter/z/7ba0ec/32.png) [@zippa71](https://forum.bricksbuilder.io/u/zippa71)\
**Post date:** [January 27, 2023, 8:46am UTC](https://forum.bricksbuilder.io/t/solved-cant-see-the-404-template/9609/2 "2023-01-27T08:46:43Z")

</div>

And yet, you need to close the page from indexing, but to make it available, how to get the product template?

```auto
add_action( 'wp', function(){
    global $post;
    if ( is_singular( 'product' ) && get_post_status( $post )=='sold' ) {
        status_header( 503 );
         include( get_query_template( 'single' )); <--------??????????
        exit;
    }

} );

```

Gives the page, but a blank screen

---

<div class="post-metadata">

**Author:** ![zippa71](https://forum.bricksbuilder.io/letter_avatar_proxy/v4/letter/z/7ba0ec/32.png) [@zippa71](https://forum.bricksbuilder.io/u/zippa71)\
**Post date:** [January 29, 2023, 9:17am UTC](https://forum.bricksbuilder.io/t/solved-cant-see-the-404-template/9609/3 "2023-01-29T09:17:05Z")

</div>

waiting for a solution!

Why is it necessary?  
I need, I think, not only me, one thing is the condition for displaying content inside the page, another thing is the condition for displaying the page as a whole, how search engines see it.  
For example, inside the template there are 3 sections with display conditions:

1. The product is available for viewing, but without the buy button, since it is not yet in stock, everything is clear here. It is indexed, visible, returns 200.
2. The goods are bought. Landing page returns 503 no matter what is indexed. Inside the template, the condition of another section works.
3. The product is in custom status. The page gives 404, for those to whom it is not intended, but in fact it is, and the condition of another section works inside the template.

This applies not only to products, but also to other types.

---

<div class="post-metadata">

**Author:** ![zippa71](https://forum.bricksbuilder.io/letter_avatar_proxy/v4/letter/z/7ba0ec/32.png) [@zippa71](https://forum.bricksbuilder.io/u/zippa71)\
**Post date:** [February 1, 2023, 12:38pm UTC](https://forum.bricksbuilder.io/t/solved-cant-see-the-404-template/9609/4 "2023-02-01T12:38:10Z")

</div>

@timmse  
Good afternoon. Finally you are back.  
Please pay attention to this post

---

<div class="post-metadata">

**Author:** ![Tom](https://forum.bricksbuilder.io/letter_avatar_proxy/v4/letter/t/3d9bf3/32.png) [@Tom](https://forum.bricksbuilder.io/u/Tom)\
**Post date:** [November 24, 2023, 1:29pm UTC](https://forum.bricksbuilder.io/t/solved-cant-see-the-404-template/9609/5 "2023-11-24T13:29:01Z")

</div>

Since I was directed to follow this thread by Itchycode on a page that had marked a 404 issue solved:

> [@SOLVED: 404 Page Template not Showing despite conditions set](https://forum.bricksbuilder.io/t/solved-404-page-template-not-showing-despite-conditions-set/15812/14):
>
> Hi @Tom, We will record this in the bug tracker. Please follow this thread for any updates [WIP: Can't see the 404 template](https://forum.bricksbuilder.io/t/wip-cant-see-the-404-template/9609) Regards, Jenn

I’ll just update it with my scenarios where the custom 404 template doesn’t get used for some reason.

The code snippet below that uses

`add_action( 'template_redirect', ...`

will not use the Bricks 404 template but just shows the default one with the “Whoops, that page is gone” message.

```auto
// For example: https://domain.com/category/uncategorized/
// If not using Category Taxonomy deleting of Uncategorized Category not possible
function ess_disable_uncategorized_category_archives() {

    // if we are on Uncategorized category archive page
    if (is_category('uncategorized')) {
        global $wp_query;
        $wp_query->set_404();
        status_header(404);
    }

}

// Disable access
add_action( 'template_redirect', 'ess_disable_uncategorized_category_archives' );

```

I also have a code snippet similar to the above that 404’s home pages that the URL may contain unneeded pagination like:

[mydomain.com/page/2/](http://mydomain.com/page/2/)

The 404 status code is returned but neither the default 404 page or my custom 404 template is returned. Instead the homepage is returned (with a 404 status code) and anything that is queried is empty.

This issue also has been discussed in most of the other topics about 404 issues.

> [@Redirection 404 not using error page template](https://forum.bricksbuilder.io/t/redirection-404-not-using-error-page-template/10789/6):
>
> No not yet. In my other post on the topic I showed Bricks where in their code it was failing to detect the 404 template but no response from them if a fix is in the works.

> [@How Do I Set a 404 Error in PHP and have the Bricks 404 Error Page show?](https://forum.bricksbuilder.io/t/how-do-i-set-a-404-error-in-php-and-have-the-bricks-404-error-page-show/12651/9):
>
> I tested it on another site with Elementor and its 404 error template is displayed. For example I usually disable access to the uncategorized Category taxonomy in WordPress if I do not use posts with the following code snippet. \<?php // For example: https://domain.com/category/uncategorized/ // If not using Category Taxonomy deleting of Uncategorized Category not possible function ess\_disable\_uncategorized\_category\_archives() { // if we are on Uncategorized category archive page if (…

---

<div class="post-metadata">

**Author:** ![itchycode](https://forum.bricksbuilder.io/user_avatar/forum.bricksbuilder.io/itchycode/32/4542_2.png) [@itchycode](https://forum.bricksbuilder.io/u/itchycode)\
**Post date:** [November 24, 2023, 1:42pm UTC](https://forum.bricksbuilder.io/t/solved-cant-see-the-404-template/9609/6 "2023-11-24T13:42:51Z")

</div>

Hi @Tom ,

As the template mechanism in Bricks is more complicated, it wouldn’t be a quick fix from the dev team.

Hence, I would suggest you use Bricks filter to achieve what you want as a workaround for now.

> **[Filter: bricks/active\_templates](https://academy.bricksbuilder.io/article/filter-bricks-active_templates/)**
>
> Modify the templates applied on a page programmatically (@since 1.8.4) This is an alternative to setting an active template via the bricks/screen\_conditions/scores filter. Please note that this filter is executed after bricks/screen\_conditions/scores...

Example: (change the 5135 to your error template ID)

```auto
add_filter( 'bricks/active_templates', 'itchy_disable_uncategorized_category_archives', 10, 3 );
function itchy_disable_uncategorized_category_archives( $active_templates, $post_id, $content_type) {
  if ( is_category( 'uncategorized' ) ) {
    global $wp_query;
    $wp_query->set_404();
    status_header( 404 );

    // Set the active templates to 404 template
    $active_templates['content'] = 5135;
    $active_templates['error'] = 5135;
    $active_templates['content_type'] = 'error';
  }
  return $active_templates;
}

```

---

<div class="post-metadata">

**Author:** ![Tom](https://forum.bricksbuilder.io/letter_avatar_proxy/v4/letter/t/3d9bf3/32.png) [@Tom](https://forum.bricksbuilder.io/u/Tom)\
**Post date:** [November 24, 2023, 2:35pm UTC](https://forum.bricksbuilder.io/t/solved-cant-see-the-404-template/9609/7 "2023-11-24T14:35:17Z")

</div>

Thanks that works and the custom 404 error template is used. It also works for a snippet I have for disabling pagination on custom post types and custom taxonomies (since I use a load more button on these and actually do not need separate pages).

It doesn’t catch the home page one though and instead a redirect happens back to the actual homepage.

`mydomain.com/page/2/`

This is better than redisplaying the homepage with empty queries as what happened before on non-existent pages though so that is okay.

---

<div class="post-metadata">

**Author:** ![floridaseating](https://forum.bricksbuilder.io/letter_avatar_proxy/v4/letter/f/a587f6/32.png) [@floridaseating](https://forum.bricksbuilder.io/u/floridaseating)\
**Post date:** [February 22, 2024, 11:39pm UTC](https://forum.bricksbuilder.io/t/solved-cant-see-the-404-template/9609/8 "2024-02-22T23:39:38Z")

</div>

still experiencing this issue:

example: [https://floridaseating.com/product-category/quick-ship/outdoor-quick-ship/404asdf](https://floridaseating.com/product-category/quick-ship/outdoor-quick-ship/404asdf)

yet it works here: [https://floridaseating.com/sdcsdc](https://floridaseating.com/sdcsdc)

---

<div class="post-metadata">

**Author:** ![timmse](https://forum.bricksbuilder.io/user_avatar/forum.bricksbuilder.io/timmse/32/1192_2.png) [@timmse](https://forum.bricksbuilder.io/u/timmse)\
**Post date:** [February 23, 2024, 11:38am UTC](https://forum.bricksbuilder.io/t/solved-cant-see-the-404-template/9609/9 "2024-02-23T11:38:18Z")

</div>

Hey,  
For me, the 404 template also works with non-existent WooCommerce categories 🤔

In order to provide a solution, I need to check the settings of your 404 error template. Could you please provide temporary admin access to your WordPress dashboard? Send the details to [help@bricksbuilder.io](mailto:help@bricksbuilder.io), referencing this thread.

---

<div class="post-metadata">

**Author:** ![floridaseating](https://forum.bricksbuilder.io/letter_avatar_proxy/v4/letter/f/a587f6/32.png) [@floridaseating](https://forum.bricksbuilder.io/u/floridaseating)\
**Post date:** [March 4, 2024, 4:12pm UTC](https://forum.bricksbuilder.io/t/solved-cant-see-the-404-template/9609/10 "2024-03-04T16:12:06Z")

</div>

just sent. @timmse !

---

<div class="post-metadata">

**Author:** ![itchycode](https://forum.bricksbuilder.io/user_avatar/forum.bricksbuilder.io/itchycode/32/4542_2.png) [@itchycode](https://forum.bricksbuilder.io/u/itchycode)\
**Post date:** [March 5, 2024, 7:56am UTC](https://forum.bricksbuilder.io/t/solved-cant-see-the-404-template/9609/11 "2024-03-05T07:56:24Z")

</div>

Hi @floridaseating ,

Thanks for the login details.  
Identified that the FacetWP - Bricks Builder integration plugin causing the issue.  
Deactivate the plugin and Bricks 404 template is working well.  
Kindly reach out to their support. Thank you.

Regards,  
Jenn

---

<div class="post-metadata">

**Author:** ![floridaseating](https://forum.bricksbuilder.io/letter_avatar_proxy/v4/letter/f/a587f6/32.png) [@floridaseating](https://forum.bricksbuilder.io/u/floridaseating)\
**Post date:** [March 5, 2024, 10:24pm UTC](https://forum.bricksbuilder.io/t/solved-cant-see-the-404-template/9609/12 "2024-03-05T22:24:11Z")

</div>

thanks for investigating. have contacted fwp regarding this issue. will update once resolved.

---

<div class="post-metadata">

**Author:** ![floridaseating](https://forum.bricksbuilder.io/letter_avatar_proxy/v4/letter/f/a587f6/32.png) [@floridaseating](https://forum.bricksbuilder.io/u/floridaseating)\
**Post date:** [March 8, 2024, 1:46am UTC](https://forum.bricksbuilder.io/t/solved-cant-see-the-404-template/9609/13 "2024-03-08T01:46:17Z")

</div>

> [@floridaseating](#):
>
> : [https://floridaseating.com/product-category/quick-ship/outdoor-quick-ship/404asdf](https://floridaseating.com/product-category/quick-ship/outdoor-quick-ship/404asdf)

faucet wp devs sent a fix, and can report it has been corrected! assuming it will be merged into upcoming release.

🙂

---

<div class="post-metadata">

**Author:** ![zippa71](https://forum.bricksbuilder.io/letter_avatar_proxy/v4/letter/z/7ba0ec/32.png) [@zippa71](https://forum.bricksbuilder.io/u/zippa71)\
**Post date:** [March 8, 2024, 10:51am UTC](https://forum.bricksbuilder.io/t/solved-cant-see-the-404-template/9609/14 "2024-03-08T10:51:00Z")

</div>

@itchycode @timmse  
By the way, the issue is not resolved.  
Everything is still the same for me. Now there are no plugins, nothing can interfere, but it still gives different 404s, an example from the author of the post above:  
1)  
[https://floridaseating.com/product-category/quick-ship/outdoor-quick-ship/404asdf](https://floridaseating.com/product-category/quick-ship/outdoor-quick-ship/404asdf)

1. 

[https://floridaseating.com/product-category23](https://floridaseating.com/product-category23)

how to deal with this?

---

<div class="post-metadata">

**Author:** ![timmse](https://forum.bricksbuilder.io/user_avatar/forum.bricksbuilder.io/timmse/32/1192_2.png) [@timmse](https://forum.bricksbuilder.io/u/timmse)\
**Post date:** [March 8, 2024, 12:29pm UTC](https://forum.bricksbuilder.io/t/solved-cant-see-the-404-template/9609/15 "2024-03-08T12:29:28Z")

</div>

Hi Maximus,  
Would you be so kind as to send temporary login credentials and a link to this thread to [help@bricksbuilder.io](mailto:help@bricksbuilder.io) using the email address you used during the purchase? Then, one of the developers can look at your problem in detail.

---

<div class="post-metadata">

**Author:** ![floridaseating](https://forum.bricksbuilder.io/letter_avatar_proxy/v4/letter/f/a587f6/32.png) [@floridaseating](https://forum.bricksbuilder.io/u/floridaseating)\
**Post date:** [March 9, 2024, 4:56am UTC](https://forum.bricksbuilder.io/t/solved-cant-see-the-404-template/9609/16 "2024-03-09T04:56:08Z")

</div>

it is resolved, just pushed the patch to production. it was not published before. but clicking both links results in expected behavior. at least for us.

---

<div class="post-metadata">

**Author:** ![Rem](https://forum.bricksbuilder.io/user_avatar/forum.bricksbuilder.io/rem/32/8727_2.png) [@Rem](https://forum.bricksbuilder.io/u/Rem)\
**Post date:** [April 11, 2024, 3:06pm UTC](https://forum.bricksbuilder.io/t/solved-cant-see-the-404-template/9609/17 "2024-04-11T15:06:32Z")

</div>

The fix we sent to @floridaseating will be included in the next update of our Bricks add-on.  
Remco @FacetWP.com

---

<div class="post-metadata">

**Author:** ![fabr](https://forum.bricksbuilder.io/letter_avatar_proxy/v4/letter/f/bc79bd/32.png) [@fabr](https://forum.bricksbuilder.io/u/fabr)\
**Post date:** [June 7, 2024, 6:53pm UTC](https://forum.bricksbuilder.io/t/solved-cant-see-the-404-template/9609/18 "2024-06-07T18:53:21Z")

</div>

The easiest way to reproduce this issue is by ticking the checkbox that tells search engines not to index (wp settings) and then trying to access the /wp-sitemap.xml page. It throws the “Whoops” page instead of the template.

---

<div class="post-metadata">

**Author:** ![fabr](https://forum.bricksbuilder.io/letter_avatar_proxy/v4/letter/f/bc79bd/32.png) [@fabr](https://forum.bricksbuilder.io/u/fabr)\
**Post date:** [April 18, 2025, 10:06pm UTC](https://forum.bricksbuilder.io/t/solved-cant-see-the-404-template/9609/19 "2025-04-18T22:06:25Z")

</div>

@timmse Any update on this bug? It’s really **not** solved. Help would be much appreciated.

---

<div class="post-metadata">

**Author:** ![timmse](https://forum.bricksbuilder.io/user_avatar/forum.bricksbuilder.io/timmse/32/1192_2.png) [@timmse](https://forum.bricksbuilder.io/u/timmse)\
**Post date:** [April 22, 2025, 7:28am UTC](https://forum.bricksbuilder.io/t/solved-cant-see-the-404-template/9609/20 "2025-04-22T07:28:26Z")

</div>

Hi @fabr ,

> [@itchycode](#):
>
> Identified that the FacetWP - Bricks Builder integration plugin causing the issue.

> [@Rem](#):
>
> The fix we sent to @floridaseating will be included in the next update of our Bricks add-on.  
> Remco @FacetWP.com

If you have a similar problem (which is not caused by a third-party plugin), please create a new report with reproducible steps. Thank you!

[Next page](https://forum.bricksbuilder.io/t/solved-cant-see-the-404-template/9609.md?page=2)
