Pages sending 403 status codes have a title "Page Not Found"

I just noticed a lot of page titles in Google Analytics that start with “Page Not Found”. I investigated for a while and it turns out that they are private forum topics that are sending 403 status codes to search engines.

I think that those pages should have a different page title so they don’t show up in analytics when people search for URLs that have the title “Page Not Found”. The pages were found, but the visitor just needs to log in.

The message on the pages themselves says: “Oops! That page is private.”

I think something like “Please log in to view this page” would be a better <title> for those pages when the settings allow anonymous visitors to see that private pages do exist.

Do you use the detailed_404 site setting?

Yes. It isn’t actually a 404 when that setting is on though — checking the box changes it to a 403. I think that the <title> should conditionally reflect that, or it distorts analytics reports.

GA4 defaults to showing page titles in reports instead of paths/URLs, and the 403s are being listed as “Page Not Found”, which isn’t correct. It should be something like “Log In to View This Page”.

The reason I want that setting on is because the email digest contains links to private topics and if people click on those and they don’t see a message that they need to log in to view the page, they will probably bounce.

1 Like

While looking at the 403 page with that setting on, I noticed that the site name is missing. I’m not sure if that’s just my site or if it’s a Discourse bug, but I see the problem on two different Discourse forums.

After looking more at that 403 page now, I’m thinking it would be better if it had a call to action there, like “Log in to view this page” with log-in/sign-in buttons. If the user then logs in and doesn’t have access, then it could say “Oops! That page is private.” That way they would know that logging in might unlock the page.

(In the meantime, I’m seeing if I can customize that in the theme.)