Answer the question
In order to leave comments, you need to log in
How to restrict access to the /uploads/ page in wordpress and should it be opened for indexing in Robots.txt?
My page /uploads/ is indexed by Yandex and is defined as poor quality.
Well, here I agree that it is of poor quality: The uploads page .
I wanted to limit it like this:
function true_block_admin_pages_error() {
global $pagenow;
$pages_to_block = array(
'page.php'
);
if(in_array($pagenow, $pages_to_block)){
// внутри скобок, в кавычках, указываем своё сообщение, HTML поддерживается
wp_die('Прости, доступ к этой странице для тебя закрыт. <a href="' .home_url(). '">Вернуться в админку.</a>');
exit;
}
}
add_action('admin_init', 'true_block_admin_pages_error')
Allow: */uploads # открываем uploads
Answer the question
In order to leave comments, you need to log in
and what for to open a listing of directories is a direct way to get hacked like a sucker , close it
in the Apache config
Options -Indexes
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question