{"id":1325,"date":"2014-05-19T15:34:15","date_gmt":"2014-05-19T06:34:15","guid":{"rendered":"http:\/\/www.santoshkori.com\/blog\/?p=1325"},"modified":"2014-05-19T15:34:15","modified_gmt":"2014-05-19T06:34:15","slug":"how-to-restrict-user-other-than-administrator-to-acess-wp-admin-in-wordpress","status":"publish","type":"post","link":"https:\/\/www.santoshkori.com\/blog\/how-to-restrict-user-other-than-administrator-to-acess-wp-admin-in-wordpress\/","title":{"rendered":"How to restrict user other than administrator to acess wp-admin in wordpress"},"content":{"rendered":"<p>Here is code  restrict user other than administrator to acess wp-admin in wordpress.<br \/>\nPut below code into your theme\/funtion.php file<\/p>\n<pre class=\"brush: php; title: ; notranslate\" title=\"\">\r\nfunction block_wp_admin_init() {\r\n\r\nif (strpos(strtolower($_SERVER&#x5B;'REQUEST_URI']),'\/wp-admin\/') !== false) {\r\n  if ( !is_site_admin() ) {\r\n     wp_redirect( get_option('siteurl'), 302 );\r\n  }\r\n}\r\n}\r\nadd_action('init','block_wp_admin_init',0);\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Here is code restrict user other than administrator to acess wp-admin in wordpress. Put below code into your theme\/funtion.php file function block_wp_admin_init() { if (strpos(strtolower($_SERVER&#x5B;&#8217;REQUEST_URI&#8217;]),&#8217;\/wp-admin\/&#8217;) !== false) { if ( !is_site_admin() ) { wp_redirect( get_option(&#8216;siteurl&#8217;), 302 ); } } } add_action(&#8216;init&#8217;,&#8217;block_wp_admin_init&#8217;,0);<\/p>\n","protected":false},"author":4,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5],"tags":[690,692,691,688,689,686,693,687],"class_list":["post-1325","post","type-post","status-publish","format-standard","hentry","category-wordpress","tag-block-user-other-than-administrator-to-acess-wp-admin-in-wordpress","tag-disable-wp-admin-for-normal-users","tag-disallow-user-other-than-administrator-to-acess-wp-admin-in-wordpress","tag-how-to-block-user-other-than-administrator-to-acess-wp-admin-in-wordpress","tag-how-to-disallow-user-other-than-administrator-to-acess-wp-admin-in-wordpress","tag-how-to-restrict-user-other-than-administrator-to-acess-wp-admin-in-wordpress","tag-preventing-users-from-accessing-wp-admin","tag-restrict-user-other-than-administrator-to-acess-wp-admin-in-wordpress"],"_links":{"self":[{"href":"https:\/\/www.santoshkori.com\/blog\/wp-json\/wp\/v2\/posts\/1325","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.santoshkori.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.santoshkori.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.santoshkori.com\/blog\/wp-json\/wp\/v2\/users\/4"}],"replies":[{"embeddable":true,"href":"https:\/\/www.santoshkori.com\/blog\/wp-json\/wp\/v2\/comments?post=1325"}],"version-history":[{"count":1,"href":"https:\/\/www.santoshkori.com\/blog\/wp-json\/wp\/v2\/posts\/1325\/revisions"}],"predecessor-version":[{"id":1326,"href":"https:\/\/www.santoshkori.com\/blog\/wp-json\/wp\/v2\/posts\/1325\/revisions\/1326"}],"wp:attachment":[{"href":"https:\/\/www.santoshkori.com\/blog\/wp-json\/wp\/v2\/media?parent=1325"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.santoshkori.com\/blog\/wp-json\/wp\/v2\/categories?post=1325"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.santoshkori.com\/blog\/wp-json\/wp\/v2\/tags?post=1325"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}