How to hide a page in wordpress. We protect and hide the admin panel through

The WordPress admin panel allows you to do most of the site management. So, with its help you can create / edit content, install / remove plugins, work with registered users, get some kind of statistics on the site, etc.

Why hide the admin panel?

By default, WordPress uses the following URLs to log into the admin panel:

Http://site.ru/wp-admin/ http://site.ru/wp-login.php

It seems to be okay, right? But, unfortunately, there is malicious software that, knowing the address of your admin panel, can harm the operation of the entire site. For example, run password guessing and gain access to the management of the entire site.

There are several ways to ensure that the entrance to the admin panel of your site is carried out at a different address specified by you. We will use a plugin that will solve the problem in one click. Thanks to him, you will not have to write a single line of code, but it will be enough just to activate the plugin and specify the desired address.

Rename plugin wp-login.php

So, after installing and activating the Rename wp-login.php plugin, you will immediately be "transferred" to the page Settings -\u003e Permalinks, where you can enter the address at which you will need to enter the administrator panel.

By default, the plugin offers an entrance to the admin panel at

Http://site.ru/login

Now, trying to navigate to the address

http://site.ru/wp-login.php

You will get a 404 error, i.e. that the page is not available.

Of course, site protection is not limited only to renaming the login address to the admin panel, but in combination with other solutions will help protect your site from bad influence.

Sometimes there are situations when you need to hide pages or posts on a site with WordPress: temporarily / permanently / from unregistered users, etc. Let's consider several options for how this can be done. Plus, I'll also tell you about one simple interesting WP Hide Post plugin.

Earlier in the blog I already had a note about how, but today we will talk about the frontend, that is, about the visibility of certain elements for visitors to your web project. By the way, if you want to hide widgets in certain places on the site, check out the module.

All the settings we need are in the "Publish" block, which is usually located to the right of the text editor. There are parameters "Visibility" and "Status".

To change some option, click on the "Change" link and select a new value. After that, be sure to save these edits. Even the absolute will understand.

Hide posts and WordPress pages completely

This approach allows:

  • hide publications from all visitors of the web resource: regardless of whether they are logged in or not, no one will be able to see the texts (of course, except for the administrator and its author).
  • remove notes from archives and general list of blog posts.

To do this, in the "Status" parameter, select the "Draft" option and click "Update".

The corresponding article will be translated into a draft version, and the labels in the block will slightly change. Only a logged in admin or the one who created this publication can view the content. To return it back to the site, you will need to click "Publish".

It is also allowed to hide pages in WordPress:

Mark several notes, and set them the selected status at the same time. Here, above the list of articles, you will see the "Drafts" link, which allows you to display them all at once.

Pages / posts for registered users, by password

Now let's try to hide WordPress posts from everyone who is not logged into the site. That is, to see private texts, people must log in with their username / password. Otherwise, the link will display a 404 error. Of course, the limitation does not apply to the administrator. To implement the task, in the "Visibility" parameter, select the "Personal" item.

If you want to set a special password for reading the article, click on the option "Password protected" and enter a specific value. After that, on the site, the visitor will need to enter a password to gain access to the content. Don't forget to click the Refresh button after configuring the settings.

By the way, the option above is not the only way to show hidden information to certain users. There is also a plugin - it generates a temporary link by which anyone can see its contents (if they know the URL).

How to hide a page in a WordPress menu

Sometimes in a project it is required to remove this or that link from the menu, but so that it is available at the direct address (drafts are not suitable). The problem arises in those templates where the automatic output of all your new pages is configured.

In this case, the issue is resolved through, where you manually add the necessary items.

Navigation editing is done in the "Appearance" - "Menu" section. Then save it. To display on the site, use the appropriate widget or function.

WP Hide Post - additional visibility options in WordPress

The module introduces a couple of interesting tricks that allow you to hide articles and WordPress pages in certain situations. By default, the system immediately adds all blog entries to the main or archives, but sometimes you want to avoid this and leave them available only via a direct link. In such cases, WP Hide Post comes in handy - it allows you to implement the task through the admin panel.

Important! After installing WP Hide Post, you need to go to its settings and in the General tab, define the types of publications for which the new visibility functions will be relevant.

The plugin was updated six months ago (I am considering version 2.0.10) and, to be honest, some of the latest comments talk about certain problems (although this is not always true). The number of 50k active downloads and the score of 4.5 indicates that everything is quite good, although there are 4 unresolved bugs. The module was tested up to WP 4.8.5.

You can hide posts in WordPress on / in:

  • main;
  • category / tag pages;
  • archives by dates, authors;
  • search results (there is also a module);
  • RSS feeds;
  • the classic view of the last posts.

Also, if desired, it is allowed to remove the link to previous / next publications in the head of your HTML code. All settings are set for a specific note. It is also important that the direct link will work + it is displayed correctly in, for example, Google XML Sitemaps and others.

There are slightly fewer options for hiding pages in WordPress:

They can be removed:

  • from the main;
  • from any navigation;
  • from all lists / items, but leave in search results.

At the same time, they are also saved in sitemaps.xml.

Thus, the WP Hide Post plugin allows you to add "specific" and SEO content to the site, which is not displayed on the main, archives, in the menu, but remains available through direct links. Remotely, by design, it looks like solutions for - Exclude categories and Ultimate Category Excluder.

If you still have questions about hiding pages in WordPress or have a story to tell, write below.

Starting with today's article, I decided to post on my blog website a whole series of articles that will be aimed at helping every WordPress site owner, without any outside help, which means completely free of charge, almost as much as possible to protect your site from hacking.

As for today's article, in it, we will talk about how to hide the administrator / admin login of a WordPress site.

Surely, many will be interested to know why this should be done at all? Therefore, to begin with, I will give an answer to this question, and then, I will clearly explain how to implement this whole thing.

As everyone knows, when publishing articles on behalf of the administrator, or at least when writing responses to comments, the author's login is displayed next to the date of publication of the article or comment. This means that it is not difficult for a potential attacker to find out the administrator's login. Therefore, knowing the login, he can start guessing the password for your admin panel without any problems, which, in fact, is not good.

Yes, of course, when installing the WordPress engine, the standard administrator name, which is "admin", can be changed to whatever your heart desires, which is what many people advise to do to improve security. However, this trick does not allow you to completely hide the display of the admin login. Moreover, even if you are using improvised means (that is, the standard feature that is available in the WordPress admin panel), change the author's display name when publishing articles and writing comments.

Who does not know, this is done directly in the admin panel itself, namely, in the "Users" menu - "Your profile". There, in the "Display as" column, you can specify which login (Name + Surname, Nickname, or just Name or Surname), instead of a username, ie the login that is used to enter the admin panel will be displayed in your posts and comments:


Many people also advise, to improve security, to completely remove the conclusion of authors in WordPress. This is done by editing the code in the corresponding theme files. But this is still not a way out of the situation, because even if you remove the authors' conclusion, i.e. they will not be visible, for anyone, the real login of the administrator, and other users (if any) too, can still be recognized, and very, very simply.

The thing is that in the WordPress engine there is, so to speak, a not entirely useful feature that allows, when you enter the following address in the address bar of the browser - "http://vash-site.ru/?author\u003d1", to see all the articles of this or another author on the blog, and with the display of his real login, and not a spoofed one.

Plus, if articles on your blog are published by more than one author, then changing the number 1 at the end of the address, to any other (2,3,4, etc.), i.e. brute force, you can easily find out their real logins.

You can make sure of this, and at the same time check your blog for this defect by adding to your domain (like http://vash-site.com) such a piece of the address "/? Author \u003d 1". If you see as a result that the address has changed to the following " http://vash-site.ru/author/your real login”, Then you should know that you should consider hiding your login immediately. Actually, I will tell you how to do this later.

How to hide admin / admin login in WordPress?

So, in order to completely remove the ability to find out the administrator login in WordPress, you need to do the following:

Find the ".htaccess" file in the root of your site and edit it by adding to it before the line " # END WordPress»The following lines of code:

RewriteCond% (REQUEST_URI) ^ / $ RewriteCond% (QUERY_STRING) ^ /? Author \u003d (*) RewriteRule ^ (. *) $ Http://vash-site.ru/? Redirect 301 / author http://vash-site.ru

Before editing, I advise you to make a backup copy of this file just in case. Well, you never know, suddenly, you do something wrong, and so, there will be an opportunity to recover.

At the same time, this address in the code - "http://vash-site.ru", you will need to replace it with the address of the main page of your blog, although, if you want, you can specify any of its other valid pages.

After entering this code and saving the entered data, now, when trying to find out your login, everyone who will do it in the above way will be transferred to the main page of your blog, well, or to the one you specify. Can't believe it? Check it out, I'm sure you will be pleasantly surprised.

That's all, as you can see, there is nothing complicated about hiding the admin login in WordPress in such a simple way.

Well, for more reliable protection of your WordPress blog from hacking, I advise you to install it on it.

That's all for me today. But finally, I would like to note one more thing. For some reason, many people think that while their resource is still young, no one will hack them. Believe me, this is not at all the case, there will always be someone who will be interested and useful in your blog. Therefore, try to immediately install appropriate protection on it, and do not postpone this matter until later, because then it may be too late.

If you run a multi-author WordPress blog or have several client sites that need to be served not only by you, but also by your editors, then you would be interested to know how to limit or even hide some of the WordPress admin elements for your users?

There are many points that users shouldn't go into. And in this article I will clearly demonstrate how to hide the wordpress admin panel, or rather, elements that are unnecessary for other users.

We will perform actions using the useful plugin Adminimize, which you can download from the official wordpress website.

Install and activate the plugin from the admin panel. After activation, go to Settings -\u003e Adminimize and shaman there.

The settings page has a Mini menu that divides the page into different sections for wordpress admin screens. Clicking on each will take you to additional options. For each section, you will see a series of items that you can deactivate or change. You will also notice the checkboxes with the choice of roles for your users.

After you have deactivated some items, you need to click on the "Update" or Update Option, which will be below, to save the changes.

Please note that the changes will not be visible on the plugin settings page. To see them in action, you will need to open a new tab in the browser and go to the admin panel in it.

We will show you each item in the Mini Menu and how to change it.

After the element "About the plugin" is the next element Admin Bar Option (in other words, administrator options). It appears whenever you enter your blog. Some of its items can be disabled or assigned to different users of your site, that is, you can set different roles for your readers.

The first option allows you to hide the user menu and its subcategories that appear in the upper right corner. After that, you will notice that it is highlighted in pinkish color. Deactivating the main menu also hides its elements. For example, you can disable the WordPress logo and it will hide all links included in it.

Among other options, you will see checkboxes where you can hide the comment icon + add a new one.

Remember that you can also hide the submenu. For example, you want to save the current menu + add a new one to the admin panel, but you still want to hide pages from it, then just add pages and enable the "deactivate" item selectively for users.

Administration option (backend)

Not all plugin settings sections will have checkboxes. The administration option is significantly different from the previous ones. It allows you to make global settings in the admin area for all types of users.

The first option here is the configuration of the info section for users at the very top right of the admin panel, which is next to the user's avatar. You can choose to either hide it, show or exit, or show only “exit”.

The next option is redirects. You can redirect the user when he "clicks" on the info section. You can already configure or redirect your user to any other page, or leave the default in the section, or hide this section. Save all this by clicking on the Update Options button.

By default, when you are working on a post (article), the publication time is hidden by a link that you can edit. To schedule a release, you must click on the edit link to make the time stamp visible.

In the administration options, you can make the date always visible.

Likewise, by default in WordPress, you can hide some of the categories in the category field on the post edit page. You can control the behavior by choosing Activate next to the Category Height option. This will adjust the height so that all of your categories are displayed.

In the footer area, you can put any of your text or link so that all users can see it on all pages of the WordPress dashboard. This can be done by clicking on the item "Advice in footer". This can be used for branding, adding a shortcode, whatever.

The last option in the plugin admin panel is to set a redirect to the WordPress admin panel. To use it you need to deactivate the panel itself first. We will talk about this in a future article.

Global settings

The section with global options allows you to activate / deactivate specific settings for different user roles. The first point here is to hide or show the admin panel. Unlike the option of the Admin bar section, which changes only the top menu of the admin panel, this checkbox will disable the entire panel for some selected user roles.

Good day!

Today I will show you how to hide a page in WordPress.

Hiding a page means excluding it from the general list of pages when displaying. But this does not mean that this page will not be indexed by search robots. That is, if the robot finds out about this page, then it will index it. This can happen if somewhere on the site there is a link to this hidden page or you or someone else notifies the search engine about this page. In general, if you need to hide the page from robots, then use the file for these purposes.

What can hiding a page from the output list be used for?

For example, when you connect Yandex or Google search on the site. To display search results on the site, you need a page. By default, it will be empty and you do not need a direct jump to it.

Or, simply, you have pages that you want to link to from other pages, but not from the home page. Also, you can display part of the links to pages in the header, and the other part in the footer or sidebar.

Earlier, I wrote. The page is hidden in a similar way, only the wp_list_pages function is used to display the list of pages.

How to find the id of a WordPress page

In order to hide a page, we need to find out its serial number, which is assigned to the page in the database (identifier or just id).

To do this, go to the section Pages.

In the list of pages, move the mouse cursor over the name of the page whose id you want to find out.

In the browser, at the bottom of the information bar, you will see the url of a link of this type:

http: //site/wp-admin/post.php? post \u003d 192 & action \u003d edit

Search this line for the value of the post parameter. In this case, post \u003d 192 is the page id. Those. in this example, the page id is 192.

Also, to see this url, you can click on the link to edit the page, and then the required url will already be at the top in the browser address bar.

Also, the id of the WordPress page can be found directly in the database in the wp_posts table. All posts with post_type \u003d "page" are pages. Those. you can get a list of all pages with the following SQL query:.

The ID field stores the identifier we need.

How to hide a page in WordPress

Now that we know the id of the page, we can proceed directly to hiding this page.

The list of pages in WordPress is displayed using the function wp_list_pages.

Open the file /wp-content/themes/your_template/header.php and find the wp_list_pages function call in it.

Here's what code was in my header.php:

If you need to hide several pages, then list their id separated by commas.