How to Hide Other Users’ Posts in the WordPress Admin Area with PLUGIN
By default, WordPress users in the admin area can see all the Posts on the site, regardless of whether they are the author.
This is not a problem for many sites. After all, most Posts on most sites are publicly available – there’s no need to hide them.
However, in some situations, site owners don’t want authors to see the Posts that other users are working on.
Fortunately, there’s an easy way to solve this problem thanks to PublishPress plugins.
Yes, this is possible. You can do it by installing the PressPermit plugin.
PressPermit is part of the PublishPress plugin suite and is supported by our team here. You can download PressPermit from WordPress.org.
It’s as simple as installing PressPermit. By default, this plugin will hide all the Posts from other users. When users in the “Author” role go to “Posts” screen they will now only see their posts.
To configure this option, go to Permissions > Settings and then click the “Core” tab. There is setting called “Hide non-editable posts”.
What this means is that users won’t be able to see any posts that they can’t edit.
Users in the “Author” role can only edit their own posts, so they will only see their own posts.
The image below shows what Author can see on a WordPress site before PressPermit is installed and correctly configured.
WordPress admin area seeing all the posts
And this next image shows what the same user sees after the plugin is activated and configured. Notice that the numbers across the top of the screen have changed. For example, “Published” has dropped from 20 to 8 and “Scheduled” has dropped from 28 to 20.
WordPress admin area only seeing all your posts
This set up is fully compatible with the Multiple Authors plugin so you can still safely assign more than one author to a post.
Restricting Authors to View Only Posts They Created
Do you want to restrict authors to view only posts they created within the admin panel? While there’s probably a plugin for this, we have created a quick code snippet that you can use to restrict authors to view only posts they created in WordPress.
Instructions:
All you have to do is add this code to your theme’s functions.php file or in a site-specific plugin:
function posts_for_current_author($query) {
global $pagenow;
if( 'edit.php' != $pagenow || !$query->is_admin )
return $query;
if( !current_user_can( 'manage_options' ) ) {
global $user_ID;
$query->set('author', $user_ID );
}
return $query;
}
add_filter('pre_get_posts', 'posts_for_current_author');
Editors and administrators will be able to see all posts. Users with other roles like contributor or authors will only see their own posts.
If you are using custom user roles on your site, then you need to keep in mind that users who can edit posts added by other users will also be able to see them.
How to Properly Add Code Snippets to Your WordPress Site
Want to know the proper way to add custom code snippets to your WordPress site? Adding code snippets to WordPress isn’t rocket science, but even the slightest mistake could crash your website. If you jump in without knowing what you’re doing, it could be fatal to your business.
So, when you’re adding custom code to your site, you’ll need to make sure you’re doing it the RIGHT WAY.
In this article, we’ll explain how to properly copy and paste code snippets to your WordPress site. Once you’ve finished reading, you’ll have the knowledge and the confidence to modify your site as you please. You might even have a bit of FUN!
Why Add Code Snippets to WordPress?
Adding code snippets to your site is one of the easiest ways to extend your website’s features. Although installing a plugin is the obvious way to enhance the built-in features of WordPress, especially for non-developers, at times, it’s hard to find a plugin that addresses your needs to the letter. On the other hand, you can find hundreds of WordPress tutorials on the web that recommend adding code snippets to meet your needs.
That said, it’s essential for you to properly insert the custom code snippets in the correct file and in the right location. Otherwise, it could crash your website, in turn sabotaging your business and reputation.
Let’s break down this tutorial into 2 different sections:
Customizing WordPress template files
Customizing functions.php file
I. Customizing WordPress Template Files
Before we dive in, let’s take a look at what a WordPress template file is.
What’s a WordPress Template?
customize a template
Every WordPress theme is made up of template files. The template files on your theme define how your website is displayed. For example, header.php is a default template used in most WordPress themes to define the header area of your WordPress-generated web pages, such as your blog articles and standalone pages.
Let’s take a look at a few default WordPress templates used by most WordPress themes.
php – defines the main page
php – defines the header section
php – defines the footer section
php – defines the functions used in the theme
php – defines the single post / blog post
php – defines the standalone page
php – defines the comments section
How to Insert Snippets Into Any Template File
You can insert code snippets into any template file, such as functions.php, single.php, etc. by either of these 2 methods: by using a child theme or by adding the code directly to your existing parent theme.
However, it’s advised not to customize the template directly in your parent theme because, when you upgrade your theme, you’ll lose all the customizations you’ve made. To preserve the tweaks even after upgrading your theme, you might want to create a child theme and make customization within it.
A child theme is a WordPress theme that inherits its functionality from another WordPress theme (the parent theme). Using a child theme is the right choice if you want to make a lot of tweaks to your template files.
Let’s take a look at how to create a child theme and insert snippets into your template file.
For a detailed guide, you can check out how to create a child theme on WordPress.
II. Customizing functions.php file
What’s functions.php file?
functions.php file
functions.php is a template file in your WordPress theme that enables you to easily extend the features of your theme and WordPress installation. To extend the features, all you have to do is add certain code snippets to your functions.php file.
Just like any other template files, you can add snippets directly to your functions.php file. In addition, to retain the customization even after upgrading your theme, you can create a child theme and insert the code within it.
However, the downside is that you’ll lose all the customization you’ve made on a child theme if you switch over to a new/different theme. This is where a site-specific plugin comes in.
A site-specific WordPress plugin is independent of your theme, which allows you to add custom snippets to your site. You can use site-specific plugin in 2 ways:
Method #1: Using a ready-made plugin, such as Code Snippets
Method #2: Manually creating a site-specific plugin
Method #1: Using a Readymade Plugin
Code Snippets is a WordPress plugin that provides a graphical interface for managing snippets similar to the Plugins menu.
It removes the need to insert custom snippets to your theme’s functions.php file. Since you’re not inserting the code in any theme files, you can preserve the customization on your site even after switching your theme.
With Code Snippets, you can activate or deactivate snippets, just like plugins.
Once you’ve activated the Code Snippets plugin, you can add custom snippets, and then specify a title, description, and tags for the snippets as reference for yourself down the line. That way, in the future, you can easily figure out the purpose of each snippet you’ve added.
2. Create a Site-Specific Plan and Insert the Code
You can manually create a site-specific plugin and insert the code within it. Unlike a ready-made plugin, a manually-created site-specific plugin is usually a basic, lightweight plugin that doesn’t have a graphical interface for managing snippets.
To make customizations, you can head over to the plugin editor and insert the code into it.
Using a Site-Specific Plugin (Manual Creation)
Step 1: Create a Site-Specific Plugin
Open a text editor on your computer, such as Notepad or TextEdit. Your plugin file needs a specific header code so that WordPress can recognize it as a plugin. Copy the following header code to your Notepad:
<?php /* Plugin Name: Site Plugin for example.com Description: Site specific code changes for example.com */ /* Start Adding Functions Below this Line */ /* Stop Adding Functions Below this Line */ ?>
Let’s name your site-specific plugin file custom-snippets.php. Bear in mind that in order to save your file as a PHP file, you’ll need to choose All Files as your Save as type.
Now create a new folder named custom-snippets and move the PHP file you’ve just created to the folder.
Next, you’ll need to compress your site-specific plugin folder, custom-snippets. Here’s how to do it:
Windows users can right-click on the folder and then click Send to » Compressed (zipped) folder.
If you’re on Mac, right click and select Compress “custom-snippets”.
Step 2: Install the Site-Specific Plugin
Now that you have created the plugin’s zip file, go to your WordPress dashboard and upload it by navigating to Plugins » Add New. Then click Upload Plugin. You’ll now be prompted to choose the correct plugin file and install it.
After installing the plugin, go ahead and activate it so you can start using the site-specific plugin.
Step 3: Using the Site-Specific Plugin
In order to add a snippet to your recently uploaded site-specific plugin, go to Plugins » Editor. On the right-hand side, you’ll see a dropdown menu Select plugin to edit. Let’s choose Custom Snippet and then click Select. You’ll now be directed to the custom-snippets.php file of your plugin.
Here, you can add the snippet of your choice below the line: /* Start Adding Functions Below this Line */
After inserting your snippet, click on Update File.
That’s it!
How to Hide Unnecessary Items From WordPress Admin with Adminimize
If you manage a multi-author WordPress blog or WordPress sites for clients, then you may have wondered if it was possible to clean up the WordPress admin area for your users? There are lots of things in the WordPress admin area that your users don’t need to see or use. In this article, we will show you how to hide unnecessary items from WordPress admin area.
Previously we showed you how to hide menu items from WordPress admin sidebar. However, there are many other aspects of the admin area that you may want to change. Like dashboard widgets, admin bar, post edit area, etc. You may also want to deactivate things based on user roles creating different admin interfaces for users with different roles and capabilities on your site. This is when Adminimize comes in.
First thing you need to do is install and activate the Adminimize plugin. Upon activation, visit Setting » Adminimize to configure the plugin settings.
The settings page has a Mini Menu that divides the settings page into different sections for different WordPress admin screens. Clicking on each link in the mini menu will take you to its options. For each section, you will see a number of items that you can deactivate or modify. You will also notice that each option has check boxes for all WordPress user roles.
Once you have checked to deactivate a few items, you need to click on the ‘Update Options »’ button below any section to store your changes.
Please note that your changes will not be visible on the plugin’s settings page. To see your changes in action, you will need to open any other admin page in a new browser tab.
We will show you each item in the Mini Menu and how to change their settings.
Admin Bar Options
After the plugin’s about section, the first option in the mini menu is the Admin Bar Options. The admin bar is the WordPress toolbar that appears on the top of each screen when you are logged in to your WordPress site.
All the items in the admin bar can be turned off or on for each user role.
The first option allow you to hide the user menu and its subitems that appear on the top right corner of the admin bar. After that you will notice that each main menu is highlighted with the pink color. Deactivating a main menu will also hide all its sub-menus. For example, deactivating WordPress logo will also hide all the links in its sub menu.
The admin bar shows your site’s name with a drop down menu containing the link to visit your site’s front-end. Checking the site name will also hide the link to visit the site’s front-end. Among other options, you will see checkboxes to hide comments icon and +New icon.
Remember that you can also hide a sub-item. For example, if you want to keep the +New menu in the admin bar, but you want to hide pages from it, then just check the pages and deactivate it for the selective user roles.
If you only wanted to switch off admin bar, then perhaps you should take a look at how to disable WordPress admin bar for all users.
Backend Options
Not all sections in the adminimize settings screen will have checkboxes. The backend options section has a slightly different look. This section allows you to set global options for all users in the admin area.
The first option here is to configure the user info menu. This is the menu that appears on top right corner of the admin screen with a user avatar. You can choose to hide it, show user and log out, or show the logout link only. The next option is to choose where to redirect users when they click on the user info link. In order to change this, you need to first change the user info menu to anything other that default or hide. After that, you need to click on the update options button below to store your changes. Now you can change the redirection option and set it to front page of your site.
Next option is for footer which allows you to hide the footer from all admin pages.
By default when you are working on a post, the timestamp option is hidden behind an edit link next to the publish information. In order to schedule a post, you need to click on the edit link to show the timestamp.
In the backend options section, you can select activate next to the timestamp option to make it visible all the time.
Similarly, by default WordPress hides some of your categories in the categories meta box on the post edit screen. You can change this behavior by choosing activate next to the Category Height option. Doing so the category meta box will adjust the height to display all your categories.
The advice in footer option allows you to put your own text in the footer area of all WordPress admin pages. This can be used for branding, adding shortcuts, or anything you want.
The last option in the Backend Options is to set a redirection for Dashboard. To use this you need to deactivate the dashboard first. We will show you how to do that later in this article.
Global Options
The global options section allows you to activate or deactivate particular settings for specified user roles. The first option here is to show or hide the admin bar. Unlike the admin bar option section which allows you to change the menus in the admin bar, this checkbox will turn off the admin bar altogether for the selected user roles.
Global Options for Adminimize
The Favorites section is no longer available in WordPress. The next few options are screen meta, screen options, and contextual help. This will deactivate the help and screen options section from WordPress admin pages.
Users on your WordPress site can go to their profiles and change the admin color scheme. To remove this feature, you can deactivate admin color scheme for selected user roles.

To change the dashboard widgets, first you need to visit the Dashboard. This will allow Adminimize to load your Dashboard widgets. After that, you need to go back to Settings » Adminimize and click Dashboard Options link from the mini menu or scroll down to Dashboard Options section. You can hide activity widget, QuickPress widget, WordPress News widget, and at a glance widget.
Deactivating dashboard widgets from WordPress admin area
If you only wanted to switch off dashboard widgets, then take a look at how to remove WordPress dashboard widgets.
Menu Options
Menu options allows you to show or hide items from your WordPress menu bar.
WordPress admin menu
Adminimize will show you an option for each menu item and all its sub-menu items. It will also show you menus added by your WordPress plugins and themes. You can check menus you want to deactivate for different user roles on your WordPress site.
Show or hide menu items from the WordPress menu bar
Write Options – Post, Page, and Post Types
You can also modify the meta boxes and write panels in the WordPress post and page edit area. To do so, click on Write Options – Post or Write Options – Page from the mini menu on Adminimize settings. You can hide almost any item that appears on the write screen.
Changing post edit screens
The first few options allow you to show / hide different meta boxes and sections from your post edit screen. It also allows you to hide items from Quick Edit area.
Widget Options
The next section in the Adminimize settings is Widget Options. This section allows you to show and hide items from the Widgets screen. You can show / hide widget ready areas and sidebars. You can also hide inactive widgets section along with hiding individual widgets from the list of available widgets.
Show or Hide items from the Widgets screen
WP Nav Menu Options
This section allows you to control Appearance » Menus screen. You can show / hide categories, pages, or custom link section from the menu screen. At the time of writing this article, the option to hide add new menu and the option to hide theme locations was not working. Hopefully in the next update this issue will be resolved.
Show / Hide sections from WP Nav Menu screen
Set Theme
Set theme option allows you to set a WordPress admin area color scheme for your users. Click on the load user data button and the plugin will load all your users.
Load user data
Once the plugin has loaded all your users, select a user and then choose a theme from them by clicking on the default theme dropdown menu. You can also select all your users and choose a default color scheme for them.
Set admin color scheme for your users
If you only wanted to set a default scheme for your users, then take a look at how to set a default admin color scheme for new users in WordPress.
Import / Export Adminimize Settings
Adminimize allows you to easily import and export your plugin settings. Using this feature, you can apply the same settings on multiple WordPress sites. To export your settings simply click on the export button and download the .seq file containing the plugin settings.
Import / Export Adminimize Settings
To import settings from an Adminimize export file simply click on Choose File button under the Import. Select the .seq file you want to import and then click on Upload file and import button.
Deinstall Options
In case you want to deactivate and uninstall the plugin, this option allows you to safely disable all plugin settings. Simply deleting the plugin may not delete all the options stored in your database. To make sure that you get it all cleaned up, check the box next to Delete Options button and then click on Delete Options.
Deinstall all Adminimize settings















