SlideShare a Scribd company logo
WORDPRESS DASHBOARD HACKS FOR
DEVELOPERS AND FREELANCERS




                       By Pankaj Subedi
SOURCE AND REFERENCES ::

 http://www.studiograsshopper.ch/
 http://www.wprecipes.com

 http://www.catswhocode.com

 http://wpsnipp.com
THE DASHBOARD IS AN ESSENTIAL PART OF
WORDPRESS, AS IT IS THE PLACE WHERE YOU WRITE
POSTS AND INSTALL PLUGINS. BUT AS A DEVELOPER
AND/OR FREELANCER, YOU HAVE TO BE CAREFUL
ABOUT WHAT YOUR CLIENTS ARE DOING ON THE
DASHBOARD OF THEIR WORDPRESS POWERED
WEBSITES. TODAY, I HAVE COMPILED 10 SUPER
USEFUL HACKS TO CUSTOMIZE, MODIFY OR ENHANCE
WORDPRESS DASHBOARD.
REMOVE MENU ITEMS FROM WORDPRESS
  ADMIN BAR
Here is a super useful code snippet for developers who wants to prevent their
clients to access some dashboard menus, such as “Plugins” or “Settings”. Paste
this code into your theme functions.php file to remove menus from the admin bar.

  function wps_admin_bar() {
    global $wp_admin_bar;
    $wp_admin_bar->remove_menu('wp-logo');
    $wp_admin_bar->remove_menu('about');
    $wp_admin_bar->remove_menu('wporg');
    $wp_admin_bar->remove_menu('documentation');
    $wp_admin_bar->remove_menu('support-forums');
    $wp_admin_bar->remove_menu('feedback');
    $wp_admin_bar->remove_menu('view-site');
  }
  add_action( 'wp_before_admin_bar_render', 'wps_admin_bar' );
REMOVE THE SCREEN OPTIONS TAB WITH
SCREEN_OPTIONS HOOK
Don’t need the “Screen Options” button? Here is a simple hack to
remove it. Paste the code below into yourfunctions.php file, save it, and
you’re done.

function remove_screen_options(){
   return false;
}
add_filter('screen_options_show_screen',
  'remove_screen_options');
CHANGE DEFAULT “ENTER TITLE HERE” TEXT
   WITHIN POST TITLE INPUT FIELD
If for some reason you need to replace the “Enter title here” text within post
title input field by a custom text, here is an easy way to do it. Define a new
text on line 2, then paste the code into your functions.php file.



  function title_text_input( $title ){
     return $title = 'Enter new title';
  }
  add_filter( 'enter_title_here', 'title_text_input' );
CHANGE DASHBOARD FOOTER TEXT

Changing the dashboard footer text is pretty easy as well. Update the code
below with your custom text on line 2, then include the snippet into
your functions.php file.



 function remove_footer_admin () {
   echo "Your own text";
 }

 add_filter('admin_footer_text',
   'remove_footer_admin');
DISABLE THE “PLEASE UPDATE NOW” MESSAGE IN
 WP DASHBOARD
Security is indeed a crucial aspect of a website and you should always
update all blogs you manage to prevent any risk of hacking. But when
working with clients, sometimes you may want to hide the “please
update now” message generated by WordPress when a new version is
available.
Simply add this code to your functions.php file to hide the message.

if ( !current_user_can( 'edit_users' ) ) {
  add_action( 'init', create_function( '$a',
   "remove_action( 'init', 'wp_version_check' );" ),
   2 );
  add_filter( 'pre_option_update_core',
   create_function( '$a', "return null;" ) );
}
DISABLE THEME SWITCHING
The best way to prevent your clients from switching theme is definitely
by disabling theme switching. Paste the following code
into functions.php and your clients will not be able to switch themes
anymore.


add_action('admin_init', 'slt_lock_theme');
function slt_lock_theme() {
  global $submenu, $userdata;
  get_currentuserinfo();
  if ($userdata->ID != 1) {
       unset($submenu['themes.php'][5]);
       unset($submenu['themes.php'][15]);
  }
}
CHANGE WORDPRESS DASHBOARD COLORS
If you ever wanted to be able to change WordPress dashboard colors
(as well as font or even display) without having to edit WordPress
core files, you’ll like this hack for sure.
The following example features a basic style change (grey header is
replaced by a blue one) but you can easily add as many styles as you
wish within the <style> and </style> tags.


function custom_colors() {
  echo '<style
  type="text/css">#wphead{background:#069}</style
  >';
}
 add_action('admin_head', 'custom_colors');
CREATE CUSTOM HELP MESSAGES
  If you’re building a site for a client and they have some problems with some
  parts of the dashboard, a good idea is to provide contextual help to the
  client.
  The following hack will allow you to add a custom help messages for the
  blog admin. As usual, you only have to paste the code into
  your functions.php file.
function my_admin_help($text, $screen) {
    // Check we're only on my Settings page
    if (strcmp($screen, MY_PAGEHOOK) == 0 ) {

          $text = 'Here is some very useful information to help you use this
    plugin...';
          return $text;
    }
    // Let the default WP Dashboard help stuff through on other Admin
    pages
    return $text;
}

add_action( 'contextual_help', 'my_admin_help' );
CHANGE WORDPRESS DEFAULT FROM EMAIL
ADDRESS
If you want to change WordPress default FROM email adress,
simply paste the following snippet into yourfunctions.php file. Don’t
forget to put the desired email adress on line 5 and desired name on
line 8.
add_filter('wp_mail_from', 'new_mail_from');
add_filter('wp_mail_from_name',
  'new_mail_from_name');

function new_mail_from($old) {
 return 'admin@yourdomain.com';
}
function new_mail_from_name($old) {
 return 'Your Blog Name';
}

More Related Content

PPTX
10 useful WordPress functions (and maybe more)
PPTX
Java script functions
PPTX
Ch2(working with forms)
PDF
Prefixルーティングとthemeのススメ
PDF
Gravity Forms Hooks & Filters
PPT
Coldfusion Tips and Tricks
PPTX
WordPress overloading Gravityforms using hooks, filters and extending classes
PPTX
May the core be with you - JandBeyond 2014
10 useful WordPress functions (and maybe more)
Java script functions
Ch2(working with forms)
Prefixルーティングとthemeのススメ
Gravity Forms Hooks & Filters
Coldfusion Tips and Tricks
WordPress overloading Gravityforms using hooks, filters and extending classes
May the core be with you - JandBeyond 2014

What's hot (20)

PPT
SQL Tuning Overview
DOCX
How to Develop Your First Ever Joomla Template?
PPT
symfony & jQuery (PUG)
PPTX
Build a Better Editing Experience with Advanced Custom Fields - #WCTO16
PPT
Paypal + symfony
PPT
WordPress as a Content Management System
PDF
7 reasons why developers should love Joomla!
PPT
symfony & jQuery (phpDay)
PPT
Oracle Forms: create debug triggers
PDF
How to create a magento controller in magento extension
PDF
How to Create A Magento Adminhtml Controller in Magento Extension
PDF
WordCamp Geneva Presentation - Customising WordPress' Admin Panel - 19 Nov. 2016
PDF
Idoc script beginner guide
PDF
How to Develop a Basic Magento Extension Tutorial
PPTX
Showroom create flow
PDF
Login and Registration form using oop in php
PDF
Some tips to improve developer experience with Symfony
PDF
Dolibarr - information for developers and partners - devcamp Pau 2019
PDF
Cloud Entwicklung mit Apex
DOCX
Add row in asp.net Gridview on button click using C# and vb.net
SQL Tuning Overview
How to Develop Your First Ever Joomla Template?
symfony & jQuery (PUG)
Build a Better Editing Experience with Advanced Custom Fields - #WCTO16
Paypal + symfony
WordPress as a Content Management System
7 reasons why developers should love Joomla!
symfony & jQuery (phpDay)
Oracle Forms: create debug triggers
How to create a magento controller in magento extension
How to Create A Magento Adminhtml Controller in Magento Extension
WordCamp Geneva Presentation - Customising WordPress' Admin Panel - 19 Nov. 2016
Idoc script beginner guide
How to Develop a Basic Magento Extension Tutorial
Showroom create flow
Login and Registration form using oop in php
Some tips to improve developer experience with Symfony
Dolibarr - information for developers and partners - devcamp Pau 2019
Cloud Entwicklung mit Apex
Add row in asp.net Gridview on button click using C# and vb.net

Similar to Top Wordpress dashboard hacks (20)

PDF
Empowering users: modifying the admin experience
PPT
WordPress Plugin Basics
PPTX
PSD to WordPress
PPTX
WordPress Structure and Best Practices
PDF
Working With The Symfony Admin Generator
PPT
WordPress basic fundamental of plugin development and creating shortcode
PDF
Laying the proper foundation for plugin and theme development
PDF
WordPress Admin UI - Future Proofing Your Admin Pages
PDF
WordPress Theme Workshop: Misc
PPTX
10 Things Every Plugin Developer Should Know (WordCamp Atlanta 2013)
PPTX
Childthemes ottawa-word camp-1919
PPTX
Building Potent WordPress Websites
PDF
Write your first WordPress plugin
KEY
Making WordPress Your CMS and Automatically Updating a Self Hosted WordPress ...
PDF
[Bristol WordPress] Supercharging WordPress Development
PPTX
WordPress customizer for themes and more
PDF
D7 theming what's new - London
PDF
Beyond the WordPress 5 minute Install
PDF
Demystifying Hooks, Actions & Filters - WordCamp Belfast 2018
PDF
Gail villanueva add muscle to your wordpress site
Empowering users: modifying the admin experience
WordPress Plugin Basics
PSD to WordPress
WordPress Structure and Best Practices
Working With The Symfony Admin Generator
WordPress basic fundamental of plugin development and creating shortcode
Laying the proper foundation for plugin and theme development
WordPress Admin UI - Future Proofing Your Admin Pages
WordPress Theme Workshop: Misc
10 Things Every Plugin Developer Should Know (WordCamp Atlanta 2013)
Childthemes ottawa-word camp-1919
Building Potent WordPress Websites
Write your first WordPress plugin
Making WordPress Your CMS and Automatically Updating a Self Hosted WordPress ...
[Bristol WordPress] Supercharging WordPress Development
WordPress customizer for themes and more
D7 theming what's new - London
Beyond the WordPress 5 minute Install
Demystifying Hooks, Actions & Filters - WordCamp Belfast 2018
Gail villanueva add muscle to your wordpress site

Recently uploaded (20)

PDF
GENETICS IN BIOLOGY IN SECONDARY LEVEL FORM 3
PDF
LDMMIA Reiki Yoga Finals Review Spring Summer
PDF
A systematic review of self-coping strategies used by university students to ...
PDF
Practical Manual AGRO-233 Principles and Practices of Natural Farming
PDF
Updated Idioms and Phrasal Verbs in English subject
PPTX
UV-Visible spectroscopy..pptx UV-Visible Spectroscopy – Electronic Transition...
PPTX
Tissue processing ( HISTOPATHOLOGICAL TECHNIQUE
PPTX
Radiologic_Anatomy_of_the_Brachial_plexus [final].pptx
PDF
A GUIDE TO GENETICS FOR UNDERGRADUATE MEDICAL STUDENTS
PDF
OBE - B.A.(HON'S) IN INTERIOR ARCHITECTURE -Ar.MOHIUDDIN.pdf
PPTX
202450812 BayCHI UCSC-SV 20250812 v17.pptx
PDF
Classroom Observation Tools for Teachers
PPTX
Final Presentation General Medicine 03-08-2024.pptx
PPTX
Microbial diseases, their pathogenesis and prophylaxis
PDF
01-Introduction-to-Information-Management.pdf
DOC
Soft-furnishing-By-Architect-A.F.M.Mohiuddin-Akhand.doc
PPTX
1st Inaugural Professorial Lecture held on 19th February 2020 (Governance and...
PPTX
Lesson notes of climatology university.
PDF
RTP_AR_KS1_Tutor's Guide_English [FOR REPRODUCTION].pdf
PDF
STATICS OF THE RIGID BODIES Hibbelers.pdf
GENETICS IN BIOLOGY IN SECONDARY LEVEL FORM 3
LDMMIA Reiki Yoga Finals Review Spring Summer
A systematic review of self-coping strategies used by university students to ...
Practical Manual AGRO-233 Principles and Practices of Natural Farming
Updated Idioms and Phrasal Verbs in English subject
UV-Visible spectroscopy..pptx UV-Visible Spectroscopy – Electronic Transition...
Tissue processing ( HISTOPATHOLOGICAL TECHNIQUE
Radiologic_Anatomy_of_the_Brachial_plexus [final].pptx
A GUIDE TO GENETICS FOR UNDERGRADUATE MEDICAL STUDENTS
OBE - B.A.(HON'S) IN INTERIOR ARCHITECTURE -Ar.MOHIUDDIN.pdf
202450812 BayCHI UCSC-SV 20250812 v17.pptx
Classroom Observation Tools for Teachers
Final Presentation General Medicine 03-08-2024.pptx
Microbial diseases, their pathogenesis and prophylaxis
01-Introduction-to-Information-Management.pdf
Soft-furnishing-By-Architect-A.F.M.Mohiuddin-Akhand.doc
1st Inaugural Professorial Lecture held on 19th February 2020 (Governance and...
Lesson notes of climatology university.
RTP_AR_KS1_Tutor's Guide_English [FOR REPRODUCTION].pdf
STATICS OF THE RIGID BODIES Hibbelers.pdf

Top Wordpress dashboard hacks

  • 1. WORDPRESS DASHBOARD HACKS FOR DEVELOPERS AND FREELANCERS By Pankaj Subedi
  • 2. SOURCE AND REFERENCES ::  http://www.studiograsshopper.ch/  http://www.wprecipes.com  http://www.catswhocode.com  http://wpsnipp.com
  • 3. THE DASHBOARD IS AN ESSENTIAL PART OF WORDPRESS, AS IT IS THE PLACE WHERE YOU WRITE POSTS AND INSTALL PLUGINS. BUT AS A DEVELOPER AND/OR FREELANCER, YOU HAVE TO BE CAREFUL ABOUT WHAT YOUR CLIENTS ARE DOING ON THE DASHBOARD OF THEIR WORDPRESS POWERED WEBSITES. TODAY, I HAVE COMPILED 10 SUPER USEFUL HACKS TO CUSTOMIZE, MODIFY OR ENHANCE WORDPRESS DASHBOARD.
  • 4. REMOVE MENU ITEMS FROM WORDPRESS ADMIN BAR Here is a super useful code snippet for developers who wants to prevent their clients to access some dashboard menus, such as “Plugins” or “Settings”. Paste this code into your theme functions.php file to remove menus from the admin bar. function wps_admin_bar() { global $wp_admin_bar; $wp_admin_bar->remove_menu('wp-logo'); $wp_admin_bar->remove_menu('about'); $wp_admin_bar->remove_menu('wporg'); $wp_admin_bar->remove_menu('documentation'); $wp_admin_bar->remove_menu('support-forums'); $wp_admin_bar->remove_menu('feedback'); $wp_admin_bar->remove_menu('view-site'); } add_action( 'wp_before_admin_bar_render', 'wps_admin_bar' );
  • 5. REMOVE THE SCREEN OPTIONS TAB WITH SCREEN_OPTIONS HOOK Don’t need the “Screen Options” button? Here is a simple hack to remove it. Paste the code below into yourfunctions.php file, save it, and you’re done. function remove_screen_options(){ return false; } add_filter('screen_options_show_screen', 'remove_screen_options');
  • 6. CHANGE DEFAULT “ENTER TITLE HERE” TEXT WITHIN POST TITLE INPUT FIELD If for some reason you need to replace the “Enter title here” text within post title input field by a custom text, here is an easy way to do it. Define a new text on line 2, then paste the code into your functions.php file. function title_text_input( $title ){ return $title = 'Enter new title'; } add_filter( 'enter_title_here', 'title_text_input' );
  • 7. CHANGE DASHBOARD FOOTER TEXT Changing the dashboard footer text is pretty easy as well. Update the code below with your custom text on line 2, then include the snippet into your functions.php file. function remove_footer_admin () { echo "Your own text"; } add_filter('admin_footer_text', 'remove_footer_admin');
  • 8. DISABLE THE “PLEASE UPDATE NOW” MESSAGE IN WP DASHBOARD Security is indeed a crucial aspect of a website and you should always update all blogs you manage to prevent any risk of hacking. But when working with clients, sometimes you may want to hide the “please update now” message generated by WordPress when a new version is available. Simply add this code to your functions.php file to hide the message. if ( !current_user_can( 'edit_users' ) ) { add_action( 'init', create_function( '$a', "remove_action( 'init', 'wp_version_check' );" ), 2 ); add_filter( 'pre_option_update_core', create_function( '$a', "return null;" ) ); }
  • 9. DISABLE THEME SWITCHING The best way to prevent your clients from switching theme is definitely by disabling theme switching. Paste the following code into functions.php and your clients will not be able to switch themes anymore. add_action('admin_init', 'slt_lock_theme'); function slt_lock_theme() { global $submenu, $userdata; get_currentuserinfo(); if ($userdata->ID != 1) { unset($submenu['themes.php'][5]); unset($submenu['themes.php'][15]); } }
  • 10. CHANGE WORDPRESS DASHBOARD COLORS If you ever wanted to be able to change WordPress dashboard colors (as well as font or even display) without having to edit WordPress core files, you’ll like this hack for sure. The following example features a basic style change (grey header is replaced by a blue one) but you can easily add as many styles as you wish within the <style> and </style> tags. function custom_colors() { echo '<style type="text/css">#wphead{background:#069}</style >'; } add_action('admin_head', 'custom_colors');
  • 11. CREATE CUSTOM HELP MESSAGES If you’re building a site for a client and they have some problems with some parts of the dashboard, a good idea is to provide contextual help to the client. The following hack will allow you to add a custom help messages for the blog admin. As usual, you only have to paste the code into your functions.php file. function my_admin_help($text, $screen) { // Check we're only on my Settings page if (strcmp($screen, MY_PAGEHOOK) == 0 ) { $text = 'Here is some very useful information to help you use this plugin...'; return $text; } // Let the default WP Dashboard help stuff through on other Admin pages return $text; } add_action( 'contextual_help', 'my_admin_help' );
  • 12. CHANGE WORDPRESS DEFAULT FROM EMAIL ADDRESS If you want to change WordPress default FROM email adress, simply paste the following snippet into yourfunctions.php file. Don’t forget to put the desired email adress on line 5 and desired name on line 8. add_filter('wp_mail_from', 'new_mail_from'); add_filter('wp_mail_from_name', 'new_mail_from_name'); function new_mail_from($old) { return '[email protected]'; } function new_mail_from_name($old) { return 'Your Blog Name'; }