Short Code

Ten ‘Must’ WordPress Snippets For Your Blog – WordPress Website Design Article

Reduce spam by using .htaccess Adding the following shortcode will let you reduce spam on your WordPress blog by using .htaccess. Simply paste the following lines into your .htaccess file but also make a note that you do make a backup of your .htaccess file before editing it. <IfModule mod_rewrite.c> RewriteEngine On RewriteCond %{REQUEST_METHOD} POST RewriteCond %{REQUEST_URI} .wp-comments-post.php* RewriteCond %{HTTP_REFERER} !.*yourdomainname.* [OR] RewriteCond %{HTTP_USER_AGENT} ^$ RewriteRule (.*) ^http://%{REMOTE_ADDR}/$ [R=301,L] </IfModule> …

Read More

Ten ‘Must’ WordPress Snippets – JustWP – WordPress Website Design Article

Remove or Hide Admin Menu Links for Certain or Specific Users or Roles The following snippet will let you remove as well as hide admin menu links for certain users or role. if (current_user_can(‘hide_jobs’)) { add_action( ‘admin_menu’, ‘my_remove_menu_jobs’ ); function my_remove_menu_jobs() { remove_menu_page(‘edit.php?post_type=job’); remove_menu_page(‘edit.php?post_type=solution’); remove_meta_box(‘dashboard_right_now’, ‘dashboard’, ‘normal’); // right now } } if (current_user_can(‘hide_jobs’)) {   add_action( ‘admin_menu’, ‘my_remove_menu_jobs’ );   function my_remove_menu_jobs() {   <span… This is…

Read More