-
Hi! I love using RankMath! I just stumbled over an issue:
404 errors are not being logged when the get_header() isn’t running in the theme. As a custom theme developer I use Timber as a templating engine. As we have a custom wrapper we do not have to run get_header to get the header.php template file. After I run into the issue that the errors weren’t being monitored I checked the RankMath code and found out that the 404 monitoring function only runs on the get_header action. Since I do not use this function within my Twig/Timber powered templates the monitoring function isn’t running.
RankMath\Monitor\Monitor::capture_404
is the function that only runs onget_header()
and is being hooked inRankMath\Monitor\Monitor::__construct
it might be a better idea to run this function on the WP filterpre_handle_404()
Let me know if I can help testing. 🙂
The ticket ‘404 monitoring not triggered when get_header() function isn’t run’ is closed to new replies.