Metaobject Web Pages Not Properly 404ing

Short description of issue

Deleted metaobject web pages are not producing 404s. Instead they display the parent level page content.

Reproduction steps

We’re seeing unexpected behavior with Metaobject Web Pages that use a nested-style path.

We have a standard page at /pages/services and dynamic metaobject entries that render under it, e.g.
/pages/services/massage

If someone visits a non-existent handle like /pages/services/empty, Shopify doesn’t return a 404 — it renders the parent /pages/services content on the /pages/services/empty page.

Because Shopify treats that as a valid page:

The 404 template never triggers

Native URL redirects (set in Online Store → Navigation → View URL Redirects) never fire.

Additional info

We solved this by implementing a Liquid check to force a 404 when no metaobject is found.

We do this by dropping the /pages/services/ string from the URL, so the page will end up just being routed to /empty and naturally 404. Then you can redirect that URL as you please.

Ideally, the invalid metaobject handles under a page could return a true 404, so native redirects on the proper URL can function.

What type of topic is this

Troubleshooting
Feature request
General discussion