Support » Plugin: 404page - your smart custom 404 error page » Had to deactivate 404Page to make WordPress correctly

  • Resolved Nejra



    After months of problem-free use of 404Page, suddenly certain admin pages in WordPress did not work anymore, with the totally unhelpful logmessages “Call to undefined function wp_get_current_user() in /home/public/sites/www.******.com/wp-includes/capabilities.php on line 522”.

    Could only make it work again by deactivating 404Page.
    As it did not make a difference at all to deactiavte or even uninstall a different very recently installed plugin – which I think was the real culprit.

    How can this be?
    Encountered similar things before, and it seems to me it has more to do with a non-robust wordpress plugin system than with the particular plugins.

    And now I am without custom 404 page 🙁

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Author Peter Raschendorfer


    There must be any other causes. The 404page plugin uses the WP core function current_user_can(), defined in wp-includes/capabilities.php. This function uses another WP core function wp_get_current_user(), defined in wp-includes/capabilities.php. That’s all WP core stuff. It’s just to check if the user is allowed to access the admin page. This is a default WP functionality. That must work. Otherwise WordPress would not work at all.

    Maybe a corrupted file? Could you please try to reinstall the 404page plugin plus WordPress itself?




    Having the same problem I was able to get around it by going to “Appearance->404 Error Page” and deselecting the “Hide the selected page from the Pages list” option.

    • This reply was modified 3 years ago by icek123.
    Plugin Author Peter Raschendorfer


    Thanks @icek123 for this clue. After detailed research I think this could happen if any other pluign – or maybe the theme – triggers a post query before all WordPress core files are completely loaded.

    Would you please do me a favor and test it with the current development version of the 404page plugin? You can download it here: I think this should solve that issue.

    Thanks in advance


    Confirmed, your dev version fixes the issue for me on a specific site that was doing the same thing with 404 Page activated.

    Could be that some other plugin was the root cause, but thanks to a recent upgrade to PHP7 I was able to see the stack trace and it lead me to 404 Page first, so that was it for me.



    Plugin Author Peter Raschendorfer


    Final version 2.4 is out now. Please confirm the issue is solved and the topic can be closed.


    Plugin Author Peter Raschendorfer


    No more response since two months. Everything works fine in my tests, so I’m marking this issue as resolved.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Had to deactivate 404Page to make WordPress correctly’ is closed to new replies.