How to change “wp-admin” to something else without search-replacing the core?

for example: foobar.com/wp/edit instead of foobar.com/wp/wp-admin

How would I do that?

Read More

I’ve tried using this in htaccess but it won’t work:

##### ABOVE THIS POINT IS ALREADY INSERTED BY WORD PRESS
##### Admin Base Rewrite #####
RewriteCond %{REQUEST_URI} wp-admin/
RewriteCond %{QUERY_STRING} !sercretword
RewriteRule .*.php [F,L]
RewriteCond %{QUERY_STRING} !secretword
RewriteRule ^secret_room/(.*) wp-admin/$1?%{QUERY_STRING}&secretword [L]
##### End Admin Base Rewrite #####
##### BELOW THIS POINT IS ALREADY INSERTED BY WORD PRESS

It was created by Michi Kono. I just can’t get it to work though.

I’m not trying to be more secure by obscurity… Its more for functionality. My site will be world editable (kind of like a wiki) but only for registered users. They will go to “/edit” instead of “/wp-admin” to edit or add content.

Thanks for the help!

NOTE: I did see this question: Can I rename the wp-admin folder?
But that doesn’t have an answer.

NOTE: Stealth Admin plugin doesn’t seem to do the trick either.

NOTE: I tried this solution: How to redirect/rewrite all /wp-login requests
But I’m not sure where in the htaccess file to place the rewrite rule with respect to the wordpress rules.

Related posts

Leave a Reply

3 comments

  1. Changing a URL always consists of two parts: changing the code that accepts the URLs (to make sure you get something when you go to example.com/edit), and changing the URLs that the code outputs in the HTML (so a link to wp-admin/ will be written as edit/).

    The first part is the easy part, and you can do it with Apache rewrite rules. This way you make make a request for example.com/edit look like it was for example.com/wp-admin.

    The second part is the hard part, and indeed requires a global search-and-replace, because it is “hard-coded” all over the place. The discussions and Trac tickets Mike linked to in his answer to the older question indicate that the core developers currently have no plans to change this, because they do not see the benefit. Indeed, your use case could also be handled in a way that does not require you to use wp-admin (moving everything to the front-end).

  2. As far as your htaccess place the code literally on the first line before any other comments or code added by wordpress or other plugins.

    As Jan mentioned rewriting consists of two parts. So beside .htaccess you need to change the admin_url filter

    function custom_admin_url($path) { 
        return str_replace('wp-admin', 'dashboard', $path); 
    }
    add_filter('admin_url', 'custom_admin_url');