Not getting any 404 log

#758161
  • Resolved Adam Larsson
    Rank Math free

    Hi!

    I’m not getting any 404 logs, it’s totally empty.

    I’m using elementor pro’s custom 404 page, don’t know if that is interrupting rank math somehow..

Viewing 7 replies - 1 through 7 (of 7 total)
  • Hello,

    I’m sorry to hear that you’re not seeing any 404 logs in Rank Math. It’s essential to monitor these logs to ensure a smooth user experience on your website.

    If you’re using Elementor Pro’s custom 404 page, it might be affecting Rank Math’s ability to log 404 errors properly. To investigate this further and resolve the issue, you can follow these steps:

    1. Check if the Rank Math 404 Monitor module is enabled by going to Rank Math SEO → Dashboard and ensuring that the 404 Monitor module is activated in Advanced Mode as shown in the screenshot below:

    Enable 404 Monitor module

    1. If the module is enabled, navigate to Rank Math SEO → 404 Monitor to access the 404 logs. If you still don’t see any logs, there might be a conflict with Elementor Pro’s custom 404 page.

    2. To troubleshoot this, you may need to temporarily disable Elementor Pro’s custom 404 page feature and check if the 404 logs start populating in Rank Math.

    If after following these steps you still face issues, please reply to this ticket, and a human agent from our support team will assist you further.

    Thank you for bringing this concern to our attention. We appreciate your patience as we work to resolve this issue for you.

    Best regards,

    Sources:
    How to Monitor 404 Errors with Rank Math SEO Plugin
    How to Fix 404 Errors with Rank Math SEO Plugin
    Common robots.txt Issues & How to Fix Them » Rank Math
    How to Find Out Where 404 Errors Are Coming From » Rank Math
    How to Setup Rank Math SEO Plugin Properly

    It seems to be elementor’s 404 that’s stealing from rankmath, becase when I disabled the elementor’s 404 it came up in the rank log..

    so.. how to solve this?

    Hello,

    Thank you for your patience.

    This usually happens when you’re using a custom 404 page on your site like the Elementor’s.

    To fix this, please update this Rank Math file via FTP – /plugins/seo-by-rank-math/includes/modules/404-monitor/class-monitor.php

    Then in line 53, change this:
    $this->action( $this->get_hook(), 'capture_404' );

    To this:
    $this->action('template_redirect', 'capture_404' );

    Once done, check again the 404 Monitor and see if it’s already logging them.

    Please note that you may need to modify the code above each time you update Rank Math to detect your 404s.

    Let us know how this goes.

    Thanks for the help, it seems to have worked.
    However, why can’t this be implanted as an option instead of relying on the users to change the code (if and when an update is happening), like “Custom error page” (on/off) ?

    Hello,

    We understand your point regarding the inconvenience of having to modify code with each Rank Math update. We appreciate your suggestion to implement a user-friendly option to enable/disable “custom error pages” directly from the Rank Math settings.

    We will forward your suggestion to our development team for consideration in future updates. We aim to provide a seamless and user-friendly experience for all our users, and your feedback helps us in achieving that goal.

    If you have any further suggestions or encounter any other issues, please feel free to let us know. We are here to assist you.

    Thank you for choosing Rank Math and for your valuable feedback.

    Luis
    Rank Math pro

    Hey,

    I am experiencing exactly the same problem. We have a 404 page outside the WordPress logic and would like to use the RankMath log. Is there anyway to call the logging function, when redirecting to the custom 404 page?

    Maybe something like this?

    <?php
    // Überprüfen, ob Rank Math das Logging aktiviert hat
    if (function_exists('rank_math') && function_exists('rank_math_404')) {
        rank_math_404();  // Rank Math loggt den 404-Fehler
    }
    
    // Setze den HTTP-Statuscode auf 404
    http_response_code(404);
    
    // Optional: Cache-Header deaktivieren
    header("Cache-Control: no-cache, must-revalidate");
    header("Pragma: no-cache");
    header("Expires: 0");
    
    // Lade den Inhalt der externen 404-Seite
    echo file_get_contents($_SERVER['DOCUMENT_ROOT'] . '/path-to-your-external-404-page/404-error.php');
    
    // Beende das Skript
    exit;
    ?>

    Thanks and best regards. Luis.

    Hello @luis-ferreira-2,

    If the 404 page is completely outside the WordPress logic this feature won’t work, not even with custom code.

    The 404 needs to be caught by WordPress first and if it’s not even hitting WordPress, it won’t be possible to track this using our plugin.

    Thank you.

    Hello,

    Since we did not hear back from you for 15 days, we are assuming that you found the solution. We are closing this support ticket.

    If you still need assistance or any other help, please feel free to open a new support ticket, and we will be more than happy to assist.

    Thank you.

Viewing 7 replies - 1 through 7 (of 7 total)

The ticket ‘Not getting any 404 log’ is closed to new replies.