• emipg

    (@emipg)


    I am getting “There has been a critical error on this website.” message only on /tag and /category urls. Sometimes it works and then it goes right back to that error message. Any other url is fine. I have run the debugging but nothing relevant is coming up. Any ideas?

Viewing 3 replies - 1 through 3 (of 3 total)
  • lcf

    (@lcf)

    What is your website URL?

    You can turn on WP Debug mode to check the error messages.

    Dr. Hafiz Adnan

    (@drhafizadnan)

    Hi @emipg

    The error message “There has been a critical error on this website” usually indicates a PHP issue or a conflict in your WordPress site. Since it occurs only on /tag and /category URLs, this suggests a potential problem related to taxonomy templates, permalinks, or a plugin conflict.

    Here are the steps to troubleshoot and resolve this issue:

    Even though debugging isn’t showing anything relevant, ensure proper setup to capture more details.

    1. Enable Debugging for More Information

    Add these lines to your wp-config.php file to log errors:

    • define( 'WP_DEBUG', true );
    • define( 'WP_DEBUG_LOG', true );
    • define( 'WP_DEBUG_DISPLAY', false ); // Errors will not show on the website but will be logged.
    • Check the debug log in wp-content/debug.log after triggering the error.

    2. Check Permalink Settings

    Sometimes permalink issues can cause errors.

    • Go to Settings > Permalinks in the WordPress admin.
    • Without changing anything, click Save Changes to flush rewrite rules.
    • Test if /tag and /category URLs work now.

    3. Verify Theme Files

    The error could stem from your theme’s taxonomy-related template files.

    • Check for the following files in your theme:
      • category.php
      • tag.php
      • archive.php
    • Temporarily switch to a default WordPress theme like Twenty Twenty-Three. If the error disappears, the issue is in your theme’s taxonomy template files.

    Fix:

    • Open the problematic template file(s) and look for any PHP errors or incorrect function calls.
    • Test by removing or commenting out custom code in those files.

    4. Disable Plugins Temporarily

    The issue might be caused by a plugin, especially if it modifies taxonomies or permalinks.

    • Deactivate all plugins.
    • Check if /tag and /category URLs work.
    • Reactivate plugins one by one, testing the URLs after each activation to identify the culprit.

    5. Check for Memory Limit Issues

    If your site runs out of memory while processing these URLs, it can lead to intermittent errors.

    • Increase the PHP memory limit by adding this to wp-config.php:
      • define( 'WP_MEMORY_LIMIT', '256M' );

    6. Inspect Custom Taxonomies

    If your site uses custom taxonomies, ensure they are registered correctly.

    • Check your theme’s functions.php file or any plugin that registers custom taxonomies.
    • Look for potential issues like missing labels, improper rewrite rules, or conflicts.

    7. Check Error Logs at the Server Level

    If WordPress debugging doesn’t provide insights, check your server’s error logs.

    • Access logs via your hosting control panel or contact your hosting support for help.
    • Look for PHP errors, such as:
      • Fatal errors
      • Memory exhaustion
      • Syntax issues

    8. Update WordPress, Theme, and Plugins

    Outdated software can cause compatibility issues.

    • Ensure WordPress, your theme, and all plugins are updated to their latest versions.
    • If you suspect a recent update caused the issue, roll back temporarily using a plugin like WP Rollback.

    9. Check for Conflicts with SEO Plugins

    If you’re using an SEO plugin (like Yoast SEO), it might be causing the issue with taxonomy URLs.

    • Temporarily disable the SEO plugin.
    • Check /tag and /category URLs again.

    Fix: If confirmed, review the plugin’s taxonomy-related settings under its configuration.

    10. Reinstall Core WordPress Files

    If none of the above works, some core WordPress files might be corrupted.

    • Reinstall WordPress core files by going to Dashboard > Updates and clicking “Reinstall Now.”

    11. Restore Default .htaccess File

    If the site uses pretty permalinks, an issue with .htaccess can cause these errors.

    • Backup your current .htaccess file.
    • Replace its content with the default:
      • #BEGIN WordPress
      • RewriteEngine On
      • RewriteBase /
      • RewriteRule ^index.php$ – [L]
      • RewriteCond %{REQUEST_FILENAME} !-f
      • RewriteCond %{REQUEST_FILENAME} !-d
      • RewriteRule . /index.php [L]
      • #END WordPress

    12. Contact Hosting Support

    If you still can’t pinpoint the issue, your hosting provider might have deeper insights based on server-side logs and configurations.

    Let me know if you need further clarification or assistance with any step!

    Hafiz

    • This reply was modified 1 week ago by Dr. Hafiz Adnan.
    • This reply was modified 1 week ago by Yui.
    Thread Starter emipg

    (@emipg)

    Thank you for your responses. I have tried a lot of these, but not all. Going to take a closer look and let you know.

Viewing 3 replies - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.