404 URL issue on Product pages

Topic summary

Main issue: Product pages are being flagged as 404 (page not found) in Ahrefs. The broken URLs appear to be derived from the product H1 titles rather than the standard product handle/slug.

Evidence: An Ahrefs screenshot (central to the report) shows multiple product URLs returning 404.

Hypotheses raised:

  • Incorrect URL structure or a mismatch between permalinks (URL slugs) and H1 titles.
  • Possible spacing/percent-encoding issue (e.g., spaces becoming %20 or similar), leading to invalid or non-existent URLs.

Key terms: 404 = page not found error; H1 = primary page headline; permalinks/slugs = the canonical URL path for a product.

Current status: Unresolved. The poster cannot locate the source in the theme/code and asks which file/logic controls the product URLs to fix it. Another participant suggests the problem stems from URL structure/H1 mismatch but provides no specific file or code change.

Outcome/next steps: No concrete fix or decision yet; discussion remains open with a focus on identifying where the URL generation/links are being formed.

Summarized with AI on December 13. AI used: gpt-5.

Hello developers & experts!

I have an issue which I cannot identify and I hope someone can help me with this.

For reference, our website URL is https://www.thecbdhut.co.uk/

When checking Ahrefs, For some reason, all of our product pages are showing a 404 error. It looks like the errored URL is using the H1 title. I am not sure what this issue is here and where I can find the issue to fix (in which code file and what to look for)

Please help if you can. I am sure it is a simple fix but I have looked thoroughly through code and I am unable to find the fix.

Here is a screenshot of the Ahrefs issue:

Thanks a lot!
Luke

The CBD Hut x Sweet Geez Vapes

The issue with your product pages showing 404 errors on Ahrefs may be due to incorrect URL structures or a mismatch between your site’s permalinks and product H1 titles.

Hello @daldaska

Yes it is most likely due to a spacing issue due to the % but I cannot find where the issue is to resolve.

Thanks,
Luke