<?xml version="1.0" encoding="UTF-8"?>        <rss version="2.0"
             xmlns:atom="http://www.w3.org/2005/Atom"
             xmlns:dc="http://purl.org/dc/elements/1.1/"
             xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
             xmlns:admin="http://webns.net/mvcb/"
             xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
             xmlns:content="http://purl.org/rss/1.0/modules/content/">
        <channel>
            <title>
									How to Change The WordPress Admin Login URL Without Plugin - Wordpress Website				            </title>
            <link>https://ankitsudhera.com/forum/wordpress-website/how-to-change-the-wordpress-admin-login-url-without-plugin/</link>
            <description>Ankit Sudhera Portfolio Website Discussion Board</description>
            <language>en-US</language>
            <lastBuildDate>Sat, 18 Jul 2026 11:22:14 +0000</lastBuildDate>
            <generator>wpForo</generator>
            <ttl>60</ttl>
							                    <item>
                        <title>How to Change The WordPress Admin Login URL Without Plugin</title>
                        <link>https://ankitsudhera.com/forum/wordpress-website/how-to-change-the-wordpress-admin-login-url-without-plugin/#post-10</link>
                        <pubDate>Thu, 15 Jun 2023 11:33:44 +0000</pubDate>
                        <description><![CDATA[There are many methods, but I will mention few as below:
First Method (Redirect using site cookie, function and htaccess):

Add below constants to wp-config.php file:
define(&#039;WP_ADMIN_DI...]]></description>
                        <content:encoded><![CDATA[<p>There are many methods, but I will mention few as below:</p>
<p><span style="font-size: 14pt"><strong>First Method </strong>(Redirect using site cookie, function and htaccess):</span></p>
<ol>
<li><span><span>Add below constants to <strong>wp-config.php</strong> file:<br /></span></span>
<pre contenteditable="false">define('WP_ADMIN_DIR', 'secret-folder');
define( 'ADMIN_COOKIE_PATH', SITECOOKIEPATH . WP_ADMIN_DIR);</pre>
<p> </p>
</li>
<li><span>Add below snippet in </span><strong>function.php</strong><span><span> file of your active theme<br /><br /></span></span>
<pre contenteditable="false">add_filter('site_url', 'wpadmin_filter', 10, 3);
function wpadmin_filter( $url, $path, $orig_scheme ) {
    $old = array( "/(wp-admin)/");
    $admin_dir = WP_ADMIN_DIR;
       $new = array($admin_dir);
    return preg_replace( $old, $new, $url, 1);
}</pre>
<span><br /><br /></span></li>
<li><span>Add below lines to </span><strong>.htaccess</strong><span><span> file<br /><br /></span></span>
<pre contenteditable="false">RewriteRule ^secret-folder/(.*) wp-admin/$1?%{QUERY_STRING} </pre>
</li>
</ol>
<p> </p>
<p><span style="font-size: 14pt"><strong>Second Method</strong> (Rename wp-login with new file like new-secret-login-file):</span></p>
<ol>
<li>Rename <em><span>wp-login.php</span></em> with new file like <em>new-secret-login-file.php</em> in the root admin folder<em><span>.</span></em></li>
<li><span>Open the </span><em><strong>new-secret-login-file.php<span> </span></strong></em><span>and find and replace every instance of "wp-login.php" in the file – then replace it with your new file name as </span><em><strong>new-secret-login-file.php</strong>.</em></li>
<li><span>Now you should be able to log in by navigating to your new URL. In our case, it’s </span><strong>domain/new-secret-login-file.php</strong><span>.<br /></span></li>
</ol>
<p>Note: If any HTTP/HTTPS requests to the <strong>/wp-login.php</strong>, or <strong>/wp-admin,</strong> directories will lead visitors to a 404 not-found page.</p>
<p><span style="font-size: 14pt"><strong>Third Method </strong><span style="font-size: 14pt">(</span>Protect <em>wp-login.php</em> With a Cookie and .htaccess):</span></p>
<ol>
<li>Add this code into your <strong>.htaccess</strong> file in the root folder.<br /><br />
<pre contenteditable="false">&lt;IfModule mod_rewrite.c&gt;
RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_COOKIE} !^.*wp\-connect=2917998723.*$ 
RewriteRule wp-login.php - 
&lt;/IfModule&gt;</pre>
<br /><br /></li>
<li>Create a new login page for cookie like new-secret-login-page.php and ad below code:<br /><br />
<pre contenteditable="false">&lt;?php
setcookie("wp-connect", 2917998723);
header("Location: wp-login.php");</pre>
<p> </p>
</li>
</ol>
<span><strong>Note</strong>: Please remember, Admins need to first go to </span><strong><em>domain/wp-connect.php</em></strong><span> to access </span><span><strong><em>wp-login.php</em></strong></span>]]></content:encoded>
						                            <category domain="https://ankitsudhera.com/forum/wordpress-website/">Wordpress Website</category>                        <dc:creator>ankitbnl406</dc:creator>
                        <guid isPermaLink="true">https://ankitsudhera.com/forum/wordpress-website/how-to-change-the-wordpress-admin-login-url-without-plugin/#post-10</guid>
                    </item>
							        </channel>
        </rss>
		