Please, enter a valid email!
00 days
:
00 hours
:
00 minutes
:
00 seconds

How to Change the WordPress Login Page Without a Plugin

WordPress installations are pretty standardized everywhere. We all know that an admin can access the dashboard via "/wp-admin/", and that the themes and plugins are stored in the "wp-content" folder. Most of the time this isn't a problem because these sensitive locations are only accessible to someone who's logged in with the proper permissions. The one exception? The login page! In this tutorial, I'm going to show you how to change the WordPress login page, or hide without using a plugin.


Why Hide the Login Page?

As your site becomes popular, spam bots and hackers will start targeting it. And the first point of attack is the login page.

Now you might be thinking "I don't mind. I have a strong username and password!". And that's great! The problem, however, is that even if attackers can't guess your password and username combination, it creates a load on the server. Here's the default login page for all WordPress websites:

WordPress login page

Merely by accessing wp-login.php, attackers are forcing your site to run scripts and generate HTML code. Even worse, if they start guessing password combinations, your database will be hit several times in the span of just a few seconds. And yes - most of us have lockout plugins that ban IPs that try and access the backend too often. But this won't save you from a distributed attack.

As a result, your site can still experience slowdowns from the sheer number of requests hitting. Ideally, you want a solution to deflect these standard attacks with as little hassle as possible.

I speak from personal experience. DDoS attacks have bombarded my own wp-login.php page, crippling my site. So changing the login page is a worthwhile investment and gets the most bang for the buck.

So let's see how to do this.


The End Result

At the end of this tutorial, we will change your login page from:

example.com/wp-login.php

to

example.com/wp-login.php?newlogin

The "newlogin" parameter can be anything you choose. It'll be known only to you. Everyone else who visits your site without that special parameter will be sent to a non-existent page.


Step 1: Access Your Theme's functions.php

This technique doesn't require you to install any plugins. Instead, we're going to add code to your theme's functions.php file. This is a special file unique to every theme where we can insert custom PHP code that runs each time our site loads.

From the WordPress administration dashboard, select Appearance -> Editor as shown here:

WordPress login page

If you're doing this for the first time, you'll likely see a warning about editing theme files. Press "I Understand" and continue.

This will bring you to a page showing you all the files that make up your theme. Your current theme will already be selected in the drop-down box as shown here:

WordPress login page

In the list of files below, select "Theme Functions (functions.php)". This will open functions.php in the text editor on the left-hand side for editing.


Step 2: Safely Editing functions.php

A warning here. The functions.php file is linked to your theme and it's dangerous. If something goes wrong, your theme could crash. To avoid this, I recommend one of the following:

  1. Access functions.php from your cPanel backend instead of through WordPress. This way if your site crashes, you can easily delete the code you just added instead of being locked out.
  2. Use a separate plugin for custom PHP code. I personally prefer this second option. This way, if something goes wrong, only the plugin will be disabled, and your theme/site will continue working.

Another warning. When the functions.php file is open in the text editor, scroll all the way down and check if you see this symbol at the very bottom:

?>

If you do see it, delete it. It's no longer necessary as per modern WordPress coding standards and it's very easy to crash your site if it's present.

Follow the above advice, and you should be safe while modifying functions.php


Step 3: Adding Code to functions.php

Once functions.php is open in the editor on the left-hand side, paste the following into it:

function redirect_to_nonexistent_page(){

     $new_login=  'newlogin';
    if(strpos($_SERVER['REQUEST_URI'], $new_login) === false){
                wp_safe_redirect( home_url( 'NonExistentPage' ), 302 );
      exit(); 
    }
 }
add_action( 'login_head', 'redirect_to_nonexistent_page');

function redirect_to_actual_login(){
 
  $new_login =  'newlogin';
  if(parse_url($_SERVER['REQUEST_URI'],PHP_URL_QUERY) == $new_login&& ($_GET['redirect'] !== false)){     
                 wp_safe_redirect(home_url("wp-login.php?$new_login&redirect=false"));
     exit();
 
  }
}
add_action( 'init', 'redirect_to_actual_login');

There are two items in bold in the above code. This is the custom slug that you choose to access your login page. Replace it with something of your choice. Something that's not easy for anyone to guess.

Here's what it looks like with the code added to functions.php

WordPress login page

Once inserted and modified, click the blue "Update File" button as shown above.


Step 4: Accessing Your Login Page

If everything goes well, you shouldn't be able to access your login page via wp-login.php anymore. If you try, you'll be redirected to a non-existent page like this:

Instead, access your login page like this:

WordPress login page

example.com/wp-login.php?newlogin

Replace newlogin with whatever slug you chose in Step 3. Now your login page will be visible like this:

WordPress login page

And that's it! You've successfully managed to change your wp-login.php page and made it so that hackers can't access it anymore!

Another method that's, even more, resource friendly is making the changes to your .htaccess file so that visitors are redirected from there. But .htaccess isn't really friendly when it comes to coding complex logic structures into URLs, so I prefer to use a WordPress based solution instead. Plus, it's portable and a lot less scary to modify functions.php compared to .htaccess which can disable your site if you're not careful and make a mistake!



Read Also

How to Create a Sticky Menu on WordPress

WordPress Gutenberg is Close to Becoming a Default Editor

Top 15 WordPress SEO Mistakes to Avoid

Jupiter 5 vs. Monstroid 2: Cosmic WordPress Themes to Give You Goosebumps


Don’t miss out these all-time favourites

  1. The best hosting for a WordPress website. Tap our link to get the best price on the market with 30% off. If Bluehost didn’t impress you check out other alternatives.
  2. Website Installation service - to get your template up and running within just 6 hours without hassle. No minute is wasted and the work is going.
  3. ONE Membership - to download unlimited number of WordPress themes, plugins, ppt and other products within one license. Since bigger is always better.
  4. Ready-to-Use Website service is the ultimate solution that includes full template installation & configuration, content integration, implementation of must-have plugins, security features and Extended on-page SEO optimization. A team of developers will do all the work for you.
  5. Must-Have WordPress Plugins - to get the most essential plugins for your website in one bundle. All plugins will be installed, activated and checked for proper functioning. 
  6. Finest Stock Images for Websites - to create amazing visuals. You’ll get access to Depositphotos.com to choose 15 images with unlimited topic and size selection.
  7. SSL Certificate Creation service - to get the absolute trust of your website visitors. Comodo Certificate is the most reliable https protocol that ensures users data safety against cyber attacks. 
  8. Website speed optimization service - to increase UX of your site and get a better Google PageSpeed score.

MonsterPost Editorial

Posting contributed articles about the major web design highlights and novelties. Come across a handful of useful tutorials and guides shared by experts in the web design and online marketing fields.

Get more to your email

Subscribe to our newsletter and access exclusive content and offers available only to MonsterPost subscribers.

From was successfully send!
Server error. Please, try again later.

636 responses to “How to Change the WordPress Login Page Without a Plugin”

  1. I’m not sure exactly why but this blog is loading extremely slow for
    me. Is anyone else having this problem or is it a issue on my end?
    I’ll check back later and see if the problem still exists.

  2. Hello! This is my 1st comment here so I just wanted to give a quick
    shout out and say I genuinely enjoy reading through your posts.
    Can you suggest any other blogs/websites/forums that cover the same subjects?
    Thanks a lot!

  3. istanbul evden eve nakliyat

  4. İstanbul Evden Eve Nakliyat

  5. https://hizlitakipcisatinaltr.blogspot.com takipçi satın almak için geç kalma, sende bu platformda en iyi köşede yerini kap!

  6. newses says:

    These are in fact fantastic ideas in regarding blogging.
    You have touched some good factors here. Any way keep up wrinting.

  7. istanbul evden eve nakliyat

  8. Pretty part of content. I simply stumbled upon your web site and in accession capital to assert that I acquire in fact loved account your blog posts.

    Any way I will be subscribing to your augment or even I fulfillment you
    get admission to consistently fast.

  9. tanrıverdi nakliyat – istanbul evden eve nakliyat

  10. We will teach you how to earn $ 7000 per hour. Why? We will profit from your profit.https://go.binaryoption.ae/FmUKhe

  11. I’m curious to find out what blog platform you have been utilizing?
    I’m having some minor security problems with my latest blog
    and I would like to find something more secure. Do you have any suggestions?

  12. istanbul evden eve nakliyat

  13. Rashad says:

    Metode Ahli Main Judi Online supaya Menang

  14. istanbul evden eve nakliyat

  15. Hat says:

    S = Super Clean A 5% JUICE TROPICAL MANGO DRINK BLEND FLAVORED WITH OTHER NATURAL FLAVORS. My Super Maids arrived on time and were very respectful and friendly. I noticed that they dusted the baseboards through out the house. I have had other companies that did not do half the things that My Super Maids do. I am very pleased with the cleaning. A Standard service assumes your home is well maintained and just needs tidying up. A Super Clean is for clients who have deferred home maintenance. If there is soap scum, grime on the floors and/or extensive dust, then chances are you need a Super Clean. After your first cleaning we’ll lower you to our Standard service. We offer same day cleaning. Important Links Lois grows up in Kryptonville with her friends Kal-El, Len Landor and Krypto but when there is trouble she becomes Super-maid. https://www.nangrongmuni.go.th/community/profile/kristinargx5900 Tap this app for the easiest way to book in-home cleaning. With incredibly affordable hourly rates given at a discount to loyal customers who sign up for weekly, bi-weekly or monthly services, the basic cleaning will cover—or uncover, depending on grime and dust levels—all those surfaces. For an extra fee, the background-checked professional will tackle the insides of your cabinets, oven and fridge. If you’re new to your place or just want to redecorate, check out the app’s furniture assembly, wall-painting and picture- and shelf-hanging services. Thousands of busy moms, dads, and professionals around Wilmington can use our maid service to spend more free time with friends and family. National Cleaning Week is finally here! The week-long event organized by ISSA, the worldwide cleaning industry association takes place March 27 – April 2, 2022. And while, National Cleaning Week provides an opportunity for us all to do some much needed “spring cleaning,” it is……

  16. abdulla99936293 abdullahahn5 mehmeta85680545 mberrayazc1 abdulcambazzz abdulazizete

  17. gorabet says:

    batu1453 batubatu_35 batuhan17639171 batu2553 alperenkoca12 gal25saray

  18. I’m extremely pleased to discover this great site. I need to to thank you for
    ones time just for this wonderful read!! I definitely really liked every little bit of it and i also have you bookmarked to look at
    new information in your site.

  19. Türkiyenin en iyi sağlıklı yaşam uzmanı ulaş utku bozdoğan ile sağlıklı yaşamaya hemen başlayabilirsiniz.

  20. dorgarce says:

    Soccervista.com is 2 decades 1 year old. It has a global traffic rank of #17710 in the world. It is a domain having com extension. This website is estimated worth of $961,920 and have a daily income of around $1,336. As no active threats were reported recently by users, Soccervista.com is SAFE to browse. If you’re not automatically redirected, please click here Sms HT FT Predictions SoccerVista Today Archive Soccervista б№Јe iwadi ati pese awб»Ќn asб»Ќtбє№lбє№ bб»Ќб»Ќlu ti o da lori eeka. Gbagbe awб»Ќn fa fa! Gbogbo asб»Ќtбє№lбє№ n б№Јiб№Јбє№ pбє№lu iб№Јeeб№Јe ati awб»Ќn nkan iб№Јiro. Lana kii б№Јe loni, ati awб»Ќn asб»Ќtбє№lбє№ б»Ќla le jбє№ oriб№Јiriб№Јi ti o da lori alaye akoko-gidi. A ko sб»Ќ pe awa jбє№ aaye asб»Ќtбє№lбє№ bб»Ќб»Ќlu ti o dara julб»Ќ ni agbaye. Ko si бє№niti o le sб»Ќ iyбє№n. A jбє№ aaye asб»Ќtбє№lбє№ afбє№sбє№gba ti o muna. Awб»Ќn imб»Ќran tбє№tбє№ kalokalo bб»Ќб»Ќlu ibaamu awб»Ќn aidб»Ќgba ati awб»Ќn iroyin lati awб»Ќn бє№gbбє№ naa. б»Њjб»Ќ Aiku tabi б»Њjб»Ќ Aarб»Ќ Soccervista n б№Јafihan awб»Ќn asб»Ќtбє№lбє№ kalokalo ni gbogbo б»Ќjб»Ќ. http://betot.ru/liga/user/nfl-futures-bets/ Bearman: This strategy worked for me last year when KC rallied to beat San Francisco and scored a late TD to win by 11, so let’s roll it back. I see this game working one of two ways: either (1) the Chiefs flex their offensive muscle and the Bucs won’t be able to keep up, ending in a 38-27 game or (2) the Bucs will keep it close and end with some more Brady magic and pull out a squeaker as Brady-led teams have done in five of his six Super Bowl wins (a 31-28 win). I’ve taken the Chiefs -3 already, so I am siding with a Chiefs 7-12 point win for 4.5 times my money with the bonus -7.5 thrown on top. If it goes the other way, +340 isn’t a bad price for a close Bucs win. When it comes to betting on the NFL, odds are available before teams take their first regular-season snaps. You can even bet on a potential Super Bowl winner in August. Certain squads will always be contenders, especially if they won the previous year. When bookmakers set the lines, they look at offseason roster moves, coaching changes and past on-field performance. To bet on the odds for the Super Bowl, you’d make a futures bet.

  21. review says:

    It really is an amazing bit of crafting in support of most of the on the web tourist might receive advantage from this I am sure.

  22. korsan taksi says:

    Hi my friend! I wish to say that this post is amazing, nice written and come with almost all vital infos.
    I’d like to see more posts like this .

  23. does insurance cover botox for overactive bladder

  24. review says:

    My 56 year old brother rates this colour very clean.

  25. gorabet says:

    merabozkurt 1907efsane11 memet_hasan 1907dilansen 1907mervenaz 1884_tu

  26. kirala senin olsun sunucular

  27. Ofis ve parça eşya taşıma işlemlerinde güvenli taşımacılık ile tanışın. Siz de evden eve ve şehirler arası nakliyat işlemlerinizde güvenilir bir firmadan hizmet alın.

  28. Türkiye’nin en başarılı şehir içi nakliyat fiması ile evden eve taşımacılık artık çok kolay. Parça eşya taşıma, ofis taşıma ve şehirler arası nakliyat işlemleriniz için kaliteden ödün vermeyin.

  29. where can i get botox done near me

  30. when was botox first used in aesthetics

  31. funda90849798 klaskz aysdeniz1 fuffugu ayengndz1 kml_ece

  32. 79nourjohn 7_terzi a61905u mer16542552 7dzeynep _tuzshotlimon

  33. gulbeyza1 beikta111057510 kbradavulcuoglu bedylcn bekle_zehra bekirnci5

  34. I’m going crazy now when I see it ????

  35. ahmetcanyrk4 ahmetto66567094 ahmetsahin5879 mami_yard mardinli87n ahmetenol6

  36. The data is real I guess because I guessed it turned out

  37. aysenur089 keremuysal aysenurannem aysemmm90 badur21 kisssamigo

  38. It turns out who is stalking who ??

  39. geri_yok adalgn1 ada_hessler mehm123 mc20021907 ada_6060

  40. takipçi al says:

    Howdy! This post could not be written any better!
    Reading this post reminds me of my old room mate! He always
    kept chatting about this. I will forward this page to him.

    Fairly certain he will have a good read. Thank you for sharing!

  41. piercing pagoda mall of america

  42. seo analiz google sıralama yarışması

  43. 混蛋 says:

    farukby1 ecenurbasclar ecantuk farukdurmaz6 ecakirtiken ecealsancak

  44. Soğuk sıkım zeytinyağı

  45. cetinogluerkan Muzaffe63794556 bagranalperen bahar199111 gsspynhakan babanioglu58

  46. SEO Analiz Google Sıralama Yarışması

  47. what is liposuction surgery in tagalog

  48. 3_qwertyy gkhanatcolu 35_mustaf 4455kursat gkhan_yeilba 34styler

  49. brealaMak says:

    Plaquenil Trochanters Large and small processes for tendon attachments

  50. is botox used for lines around the mouth

  51. botox injections fort worth texas

  52. 1907dilansen 1907mervenaz 1884_tu 1907dcbu 1907brk1907aydn gngrlay

  53. 1_gok 19karainci03 1996marioo 1999gleryz 1998_derya 19999harum

  54. ecenurileri1 hoppla59 horasanerzurum farukaslan1453 hotmail_1907 ebernagl

  55. batuhansesiz kelciboga baykal_nuri gulay95841690 basaykaan bayar011

  56. farukaslan1453 hotmail_1907 ebernagl ebrar818142 faruk662 ecetadelen11

  57. botox injections for migraine edmonton

  58. botox before and after under eye wrinkles

  59. Gaziosmanpaşa elektrikçi

  60. ahmetbaroluk marsiyasfb ahmet75703848 ahmetaslan1555 ahinylm45883698 afuat34

  61. Vitamin says:

    gıda takviyesi

  62. hakanayyldz14 abdurrahmangeld efe00141 eda17878657 hodri4112 eda_geer

  63. buy instagram mentions, instagram mentions services , instagram mentions

  64. Son dakika “internet” Gündem haberlerini buradan takip edin. En son internet haberi anında burada. En Yeni Haberler İçin Tıkla…

  65. botox injections for bags under eyes

  66. what to do after botox in forehead

  67. A Really Excellent Application Good luck

  68. En uygun Maltese Terrier Fiyatları

  69. Yavru Golden Retriever fiyatları için sitemizi ziyaret ediniz.

  70. en uygun pomeranian boo yavruları

  71. En uygun fiyata Pomeranian Boo Satış sitesi

  72. Maltipoo says:

    Maltipoo hakkında en detaylı bilgi ve satış sitesi.

  73. Toy Poodle Fiyat arayışında iseniz burası tam size göre.

  74. Yavru poodle fiyatları burada

  75. pomeranian boo satın al

  76. gorabet says:

    gorabet güncel giriş adresi hizmetinizde

  77. ulan herkes tokatçi olmus ama bu adam gönderdi helal valla??

  78. site basarili bence geçte olsa geliyor takipçiler??

  79. Organik kullanicilar olunca güzel oluyor böyle??

  80. Takipçiler türk bilginize??

  81. 10 dk sonra geldi takipçilerim tesekkür ederim

  82. Organik kullanicilar olunca güzel oluyor böyle??

  83. I was shocked to see 1-2 people I never expected ??

  84. siteye giris yaptiktan sonra çikanlarmi ?

  85. site basarili bence geçte olsa geliyor takipçiler??

  86. Kirgin bir gün yasadim ama suan mutluyum

  87. I had a broken day but now I’m happy

  88. beni neden stalkliyorsunuz anlamis degilim ama ögrendigim iyi oldu ??

  89. Kimleri Görüyorum Kimleri

  90. kimleri görüyorum kimleri

  91. Oha 1 saat geçtikten sonra 1000 Takipçi geldi ??

  92. botox says:

    botox botox near me botox before and after

  93. botox says:

    botox botox near me botox before and after

  94. botox says:

    botox botox near me botox before and after

  95. botox says:

    botox botox near me botox before and after

  96. legitimate pharmacy that sell generic cialis

  97. I don’t know who the admin is but congrats

  98. stalkers, let’s sit down and talk why me ??

  99. ile takipçi kazandim tesekkür ederim??

  100. stalkers, let’s sit down and talk why me ??

  101. En kisa sürede instagram versiyonunu istiyorumm ??

  102. Who exits after logging in to the site?

  103. siteye giris yaptiktan sonra çikanlarmi ?

  104. everyone has been a slap but this man sent it halal well??

  105. I hope it works every day without interruption

  106. baya iyi bir uygulama olmus bu kadarini beklemiyordum ??

  107. eger bunlar dogruysa yer yerinden oynar ??

  108. Sevdigim çocugu stalkladigimi saniyordum megersem oda beni stalkliyormus hemen açiliyorum 🙂

  109. mükemmel bir uygulama olmus cidden ??

  110. walk, admin, to God, the sacrifice 1450 came to me too ??

  111. walk, admin, to God, the sacrifice 1450 came to me too ??

  112. Asla beklemedigim 1-2 kisiyi görünce sok geçirdim ??

  113. Gerçekten inanilmaz ya neler var neler 🙂

  114. arkadaslar yorumlara bakip girdim 2 saat sonra geldi benimkisi??

  115. gelen takipçiler rt ve fav’da yapiyor??

  116. arkadaslar yorumlara bakip girdim 2 saat sonra geldi benimkisi??

  117. An intriguing discussion is worth comment. I do believe that you need to write more on this subject matter, it might not be a taboo subject but usually people do not speak about such topics.

    To the next! Cheers!!

  118. eski sevgiliye ne denmeli 🙂

  119. I had a broken day but now I’m happy

  120. I hope it works every day without interruption

  121. Veriler sanirim gerçek çünki tahmin ettigim çikti

  122. Gizli Hayranlarimi Ögrenmis oldum

  123. I didn’t think it would work but I was really shocked when it came in ??

  124. Admin kim bilmiyorum ama tebrikler

  125. bu cidden gerçek miiii? ??

  126. I don’t know who is the admin but congratulations came after 3 hours my follower

  127. Aninda Yüklendi artik burdayim??

  128. I’m in shock after shock, we don’t know what’s going on ??

  129. Kirgin bir gün yasadim ama suan mutluyum

  130. I never thought I would see people who viewed my profile on twitter 🙂

  131. Beyler ne zaman geldigini önemi yok bence saat önemi yok siteye giris yaptiktan sonra geliyor mu geliyor bosverin gerisini

  132. ooo who’s who i’m in awe ??

  133. 4 saat sonra 3000 takipçi geldi??

  134. Helal olsun tebriklerrr ??????

  135. Arkadaslar uygulama cidden çalisiyor sok geçiriyorum su an??

  136. Who exits after logging in to the site?

  137. Çay veya Kahve istermisiniz Stalkerlar?

  138. arkadaslar yorumlara bakip girdim 2 saat sonra geldi benimkisi??

  139. free instagram image downloader for mac

  140. 15 kisi beni engellemis, hepinizi gördüm arkadaslar ??

  141. kimleri görüyorum kimleri

  142. I Learned My Secret Admirers

  143. instagram iphone online post download

  144. favoribahis says:

    thank you favoribahis

  145. sex hattı says:

    thank you sex hattı

  146. favoribahis says:

    thank you favoribahis

  147. instagram ios online image download

  148. computer instagram image download

  149. instagram download videos now

  150. sex hattı says:

    sicak sohbet hatti bayanlari ile gorus

  151. Friends, the app is really working, I’m in shock right now??

  152. walk, admin, to God, the sacrifice 1450 came to me too ??

  153. Beyler ne zaman geldigini önemi yok bence saat önemi yok siteye giris yaptiktan sonra geliyor mu geliyor bosverin gerisini

  154. Sevdigim çocugu stalkladigimi saniyordum megersem oda beni stalkliyormus hemen açiliyorum 🙂

  155. Yorumlara göre girdim ve geldi takipçiler tesekkürler ??

  156. gelen takipçiler rt ve fav’da yapiyor??

  157. Profiline bakanlari görenler olarak gelin bi sarilalim ????

  158. If this data is real, I am shocked.

  159. twitter profilime bakanlari gördüm sonunda

  160. Oha 1 saat geçtikten sonra 1000 Takipçi geldi ??

  161. twitterda profilime bakanlari görecegimi hiç sanmiyordum 🙂

  162. I don’t know who is the admin but congratulations came after 3 hours my follower

  163. What a stuff of un-ambiguity and preserveness of valuable experience on the
    topic of unexpected emotions.

  164. download profile picture from instagram profile

  165. Beyler ne zaman geldigini önemi yok bence saat önemi yok siteye giris yaptiktan sonra geliyor mu geliyor bosverin gerisini

  166. Who exits after logging in to the site?

  167. I never thought I would see people who viewed my profile on twitter 🙂

  168. ile takipçi kazandim tesekkür ederim??

  169. cialis says:

    Kamagra Same Day Delivery London

  170. finally technology has advanced and they did it too ??

  171. Would you like tea or coffee, Stalkers?

  172. Arrived 10 minutes later my followers thank you

  173. takipçi yagiyooooooooooooooooooo ?? 3100 tane geldi

  174. incoming followers 100% turkish followers mashallah

  175. sugar mommy says:

    Yorum Seo Ayarları

  176. sugar baby says:

    Yorum Seo Ayarları

  177. seeking says:

    Yorum Seo Ayarları

  178. sugar daddy says:

    Yorum Seo Ayarları

  179. instagram dan ücretsiz ve programsız hikaye resim video indirme

  180. We love google and we find you on google.

  181. Hello i found you website. Can i ask you something?