Home » Blog » WordPress » How to fix 404 errors for new Custom Post Types (CPT) when using TranslatePress

How to fix 404 errors for new Custom Post Types (CPT) when using TranslatePress

Updated:   WordPress 1 min read

Your support helps keep this blog running! Secure payments via Paypal and Stripe.


My client’s site uses TranslatePress to manage two languages, with the ‘Subdirectory for default language’ setting enabled. While the existing Custom Post Types (CPTs) have been working perfectly with TranslatePress, I recently encountered an issue after adding a new CPT.

The URLs for this new CPT were consistently resulting in 404 errors. Fortunately, I was able to identify the cause and resolve the issue. Here is the solution I implemented.

My Solution

I disabled the ‘Use a subdirectory for the default language’ option and flushed the permalinks twice. After checking the CPT URLs in both languages, the 404 errors were resolved. I then re-enabled the subdirectory option, flushed the permalinks again, and confirmed that the CPT content now renders correctly for both languages.

TranslatePress support has confirmed that my solution is correct.

Explanation

When you enable the ‘Use a subdirectory for the default language’ option, TranslatePress modifies the WordPress URL routing logic. This ensures that all language versions—including the default—are served under their respective prefixes (e.g., /th/ and /en/).

If you register a new Custom Post Type (CPT) while this setting is active, WordPress must regenerate its permalink structure (rewrite rules) to correctly map the new CPT URLs within those language subdirectories. Since this regeneration does not always trigger automatically upon CPT registration, it can lead to the 404 errors you encountered.

I hope you found this helpful. If this saved you time, please consider buying me a coffee.


Your support helps keep this blog running! Secure payments via Paypal and Stripe.


Share this:
Senior WordPress Developer (Freelancer)

Senior WordPress Developer (Freelancer)

I’m a professional WordPress and WooCommerce developer based in Chiang Mai, Thailand, with over a decade of experience creating fast, secure, and scalable websites. From custom themes and plugins to full WooCommerce stores, I help businesses build a strong and reliable online presence. Need a freelance WordPress developer you can count on? View my portfolio or get in touch to discuss your project.