Customise WordPress Update Notice in wp-admin backend area

I did not find any hook available to customize the message. So decided to remove the original update nag and have our custom nag over there. Lets first remove the original nag // Admin menu hook add_action( ‘admin_menu’, ‘remove_core_update_nag’, 2 ); /** * Remove the original update nag */ function remove_core_update_nag() { remove_action( ‘admin_notices’, ‘update_nag’, … Read more

New wordpress install, what are the reasons the “Install Themes” tab is missing?

One of possible reason is you/automated installation might have turned off installation of new themes and plugins in wp-config.php. Make sure you do not have DISALLOW_FILE_MODS true in your wp-config.php file. define( ‘DISALLOW_FILE_MODS’, true ); If it is then remove this line. Enabling this option in config file will disallow updates and installations of new … Read more

Redirect non-admin users away from wp-admin/index.php (main dashboard page) to wp-admin/profile.php

The easiest solution is to hook in load-index.php and redirect non-admin users to their profile. Effectively blocking access to that page. I’m going to wrap the permission check up in a function for this example (we’ll use it more than once). function _wpse206466_can_view() { // or any other admin level capability return current_user_can(‘manage_options’); } add_action(‘load-index.php’, … Read more

Limit access to wp_admin

IMHO this is not the best method of protecting your WP Admin. IPs can be spoofed. This method also restricts you to specific IPs which can be annoying if you wish to access it from a different office/location. I’d recommend either a simple server-based password protection on the wp-admin directory. Of course, the downside is … Read more

How to declutter admin columns

Admin columns can be shown/hidden by using the Screen Options menu. Here, the custom column Headline news is being hidden using the UI: Alternatively, Admin Columns can be unset (and therefore hidden) programmatically: add_filter( ‘manage_post_posts_columns’, ‘wpse_hide_columns’, PHP_INT_MAX, 1 ); function wpse_hide_columns( $columns ) { // Check for the name of the column, and unset it … Read more

Woocommerce: Add column to ORDERS admin page with items purchased

I have already manage to create a column thanks to this: // ADDING COLUMN TITLES add_filter( ‘manage_edit-shop_order_columns’, ‘custom_shop_order_column’,11); function custom_shop_order_column($columns) { //add columns $columns[‘my-column1’] = __( ‘Column Title’,’theme_slug’); return $columns; } // adding the data for each orders by column (example) add_action( ‘manage_shop_order_posts_custom_column’ , ‘custom_orders_list_column_content’, 10, 2 ); function custom_orders_list_column_content( $column ) { global $post, … Read more