{"id":271,"date":"2018-12-24T11:55:19","date_gmt":"2018-12-24T11:55:19","guid":{"rendered":"https:\/\/meetanshi.com\/blog\/2018\/12\/24\/change-admin-url-in-magento-2\/"},"modified":"2025-05-22T17:10:19","modified_gmt":"2025-05-22T11:40:19","slug":"change-admin-url-in-magento-2","status":"publish","type":"post","link":"https:\/\/meetanshi.com\/blog\/change-admin-url-in-magento-2\/","title":{"rendered":"How to Change Admin URL in Magento 2"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">Magento 2 is widely used CMS for E-commerce stores. Security, which is of prime importance, is given utmost priority in the CMS. Here, I\u2019ll discuss one of the ways to implement security in the store, i.e., change admin URL in Magento 2.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The admin URL is used to access the backend of the store. It allows editing as well as manage the administrative tasks. However, the default format of the URL, \u201c<strong>sitename.com\/admin<\/strong>\u201d is vulnerable to bots. It is easy to crack the predictable names such as a backend, admin, etc.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">It is good practice to have a unique name of the admin URL that\u2019ll help protect the backend admin from automated software\u2019s hacks or bots attack. Experts recommend to&nbsp;<em><strong>change admin URL in Magento 2<\/strong><\/em>, hence I\u2019ve come up with the method for the same!<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Methods to Change Admin URL in Magento 2:<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">There are 3 methods to set custom Magento 2 admin URL:<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>1. via SSH<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Run this command:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>php bin\/magento setup:config:set --backend-frontname=\"admin_path\"<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Here set whatever URL you wish to set in place of \u201c<strong>admin_path<\/strong>\u201c.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>2. Manually<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li> Navigate to&nbsp;<strong>app\/etc\/env.php<\/strong><\/li>\n\n\n\n<li>Change \u2018frontName\u2019 =&gt; \u2018admin\u2019,<\/li>\n\n\n\n<li>Clear cache<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>3. via Admin panel<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Log in the&nbsp;<strong>Admin panel<\/strong><\/li>\n\n\n\n<li>Navigate to&nbsp;<strong>Stores &gt; Configuration<\/strong><\/li>\n\n\n\n<li>Click on&nbsp;<strong>Admin<\/strong>&nbsp;under<strong>&nbsp;Advanced&nbsp;<\/strong>section.<\/li>\n\n\n\n<li>Under Advanced, click Admin and expand the Admin Base URL section.<\/li>\n\n\n\n<li>Set&nbsp;<strong>Use Custom Admin URL<\/strong>&nbsp;to \u201cYes\u201d.<\/li>\n\n\n\n<li>Enter the<strong>&nbsp;custom admin URL<\/strong><\/li>\n\n\n\n<li>Also, you can enable the \u201c<strong>Use Custom Admin Path<\/strong>\u201d field and just set the&nbsp;<strong>custom admin path&nbsp;<\/strong>instead of the entire URL. This is an alternate method.<\/li>\n\n\n\n<li>You will be logged out and redirected to the new Admin URL.<\/li>\n<\/ul>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" src=\"https:\/\/meetanshi.com\/blog\/wp-content\/uploads\/2018\/12\/Change-backend-URL-from-admin-panel.png\" alt=\"Change-backend-URL-from-admin-panel\" class=\"wp-image-3974\"\/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">These methods are handy to set custom admin URL in Magento 2. Though the method does not guarantee 100% security from bots, it does contribute to your efforts to secure the admin panel.<br>After using one of the methods to change the admin URL in Magento 2, you can type the new admin URL and log in as usual. Apart from securing the Magento 2 store against bots and attackers, changing your default admin URL is the tiny step towards the larger security endeavor.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">For similar solution in Magento 1, check&nbsp;<a href=\"https:\/\/meetanshi.com\/blog\/change-admin-url-in-magento\/\">Change Admin URL in Magento<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Magento 2 is widely used CMS for E-commerce stores. Security, which is of prime importance, is given utmost priority in the CMS. Here, I\u2019ll discuss&#8230;<\/p>\n","protected":false},"author":5,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[34],"tags":[],"class_list":["post-271","post","type-post","status-publish","format-standard","hentry","category-magento"],"acf":[],"_links":{"self":[{"href":"https:\/\/meetanshi.com\/blog\/wp-json\/wp\/v2\/posts\/271","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/meetanshi.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/meetanshi.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/meetanshi.com\/blog\/wp-json\/wp\/v2\/users\/5"}],"replies":[{"embeddable":true,"href":"https:\/\/meetanshi.com\/blog\/wp-json\/wp\/v2\/comments?post=271"}],"version-history":[{"count":4,"href":"https:\/\/meetanshi.com\/blog\/wp-json\/wp\/v2\/posts\/271\/revisions"}],"predecessor-version":[{"id":15539,"href":"https:\/\/meetanshi.com\/blog\/wp-json\/wp\/v2\/posts\/271\/revisions\/15539"}],"wp:attachment":[{"href":"https:\/\/meetanshi.com\/blog\/wp-json\/wp\/v2\/media?parent=271"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/meetanshi.com\/blog\/wp-json\/wp\/v2\/categories?post=271"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/meetanshi.com\/blog\/wp-json\/wp\/v2\/tags?post=271"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}