Customise WordPress Dashboard for Clients

To keep your clients from risky places or to restrict access to specific pages from the clients, you can customise your WordPress dashboard by adding the below code in your theme’s functions.php. This code allows you to hide parts of the WordPress dashboard menu.

You need to uncomment the line ( remove // ) for the page that you want to hide/remove from the WordPress menu.

Be aware that this only hides the menu items from the dashboard and clients can still theoretically access these menus with a direct link (if they know).

Code snippet to customise #WordPress Dashboard for Clients #snippet Click To Tweet

Best practice to disable error reporting in WordPress

I have seen a few posts that developers looking for a way to disable PHP notices or to disable php warnings showing up in WordPress.

Some tutorials suggests putting the following code at the top of wp-config.php file disables PHP errors:

error_reporting(0);

But unfortunately this does not work, however, because when that file calls wp-settings.php at the bottom, the error reporting will be overridden by WordPress’s own settings.

In order for the above line to work, it must come after the call to wp-settings.php or at the end of wp-config.php file, like below…

/** Sets up WordPress vars and included files. */
    require_once(ABSPATH . 'wp-settings.php');

error_reporting(0);

If you want to enable WP_DEBUG, you will have to comment out this line otherwise it won’t display any debugging errors.

Best practice to disable error reporting in WordPress. #WordPress #WordPressTips Click To Tweet