作者: iamwinter

  • WordPress Block Editor Issue: Template Part Has Been Deleted or Is Unavailable

    Background

    In a fresh installation of WordPress 6.8.1, without any theme switching or configuration changes, users may encounter the following message when first accessing the block editor (such as the Header or Footer templates):

    Template part has been deleted or is unavailable

    Many users mistakenly assume this is due to a faulty theme or installation. In reality, the root cause often lies in improper SSL configurations on the server.


    Root Cause Analysis

    One of the most common reasons for this issue is: misconfigured SSL on the server or a conflict with Cloudflare’s SSL settings.

    When WordPress attempts to load or save block components, if the communication is deemed insecure or interrupted (e.g., an “offline user” message appears), certain parts may become unavailable or unsavable—resulting in the “Template Part Missing” error.


    Common Error Scenarios

    • Cloudflare SSL is set to “Flexible”
    • The origin server does not have a valid HTTPS or SSL certificate
    • HTTPS redirection or HSTS is not enabled, making the connection appear insecure to the editor

    Solution

    Using Hestia Control Panel as an example, ensure the following settings are enabled:

    1. ✅ Enable SSL for the target domain
    2. ✅ Obtain a valid SSL certificate via Let’s Encrypt
    3. ✅ Enable “Force HTTPS” redirection
    4. ✅ Enable “HTTP Strict Transport Security (HSTS)”

    Then, in your Cloudflare dashboard, confirm the following:

    • 🔐 Set the SSL mode to Full
    • ❌ Avoid using the “Flexible” mode, which can interrupt the SSL chain between the browser and the origin server

    Tips

    • If you’re using caching plugins or a CDN, clear the cache and refresh the editor page.
    • If the issue persists, inspect your browser’s developer console for network errors or SSL warnings to help isolate the problem.

    Other Possible Causes and Fixes

    Besides SSL configuration issues, community discussions and GitHub threads have highlighted other possible causes:

    • 🔧 Theme or template part registration issues: Some themes may not properly register template parts. Try switching to a default theme such as Twenty Twenty-Four to test.
    • 🧩 Gutenberg plugin conflicts: If you have the Gutenberg plugin installed, try updating it or temporarily deactivating it to see if the issue resolves.
    • 🛠️ Missing database entries: Check the wp_post table to ensure there are valid template-part post types present.

    For further insights, see:


    Conclusion

    Although this error appears to be theme-related, it is often caused by incorrect SSL setup. Ensuring consistency between your server’s SSL configuration and Cloudflare settings—especially enforcing full HTTPS—can effectively resolve the “Template Part Missing” issue in the WordPress block editor.

    Secure infrastructure is the foundation of a truly “visual” editing experience.