Hide Admin Username

Video Transcript

In this class, we’re going to demonstrate an alternative method to hiding your admin username from that URL that we use in the previous class.

Let me show you which one I’m talking about this one here, where we have the domain name forward slash question mark, author equals, and then the admin ID being number one. Well, first off, if you use that method in the previous class, and you’ve already changed this, and you can skip this unless you just want to know this method for future reference, because frankly, I kind of like this one, it’s a lot easier, and you don’t have to worry about digging into your PHP myadmin. It’s Matter of fact, I went ahead and change that back for this demonstration. So if we go ahead and hit enter, now, it’s going to display the username for the administrator, which is assigned to that number one, user ID, well, we don’t want that.

So here’s the method I’m going to recommend over into the other methods of hiding your admin username, now does involve code, but not to worry as before, I’m going to provide you with a copy and paste text document that contains this code. So I got to do is open it up, copy and paste where I show you. Now there’s a couple ways in which we can do this one is owned by Lake and see here, I’ve changed that back to the ID number one. One way is to use this copy and paste code and put it into your themes function dot php file.

And if you have never opened up your theme editor before, you’ll get presented with a box that says, Wait a minute, are you sure you want to do this, I’m kind of paraphrasing here, because this is something that will break your site if you don’t know what you’re doing. And this is not the recommended method of adding code to a theme. Ideally, you should be using a child theme. If you’re going to customize code.

That’s the makings for a different class all together. But the file that you will be editing is the functions dot php file. And whether it’s in the parent theme, or the child theme, you would open that up in your editor window, scroll all the way to the very bottom. And here is where you would add the code that I’m going to show you in just a second. Again, this is not recommended. If you are you going to edit a theme, it’s best to do so in the themes child theme. And you got to create one for that drawback to that whether it’s a child theme, or the parent theme, is that the code that I’m going to provide you this method will not work. If you change themes.

I mean, it will but you’ll have to go back into that theme and repeat this process. So editing your theme will work. But the other method I want to show you will work no matter how many times you switch themes, but it is another plugin. So I wanted to give you options. He tried to limit your use of plugins, use option one. But if you don’t want to mess with editing your theme every time you change themes will then use option two. So let’s go into plugins. We’re going to skip the theme thing. Going to plugins add new in the search plugins box type in code snippets.

And it’s this one right here by code snippets Pro, click on install now. and activate, go into snippets. And you can see there’s a whole lot more to this plugin than what I’m going to be demonstrating. So if you want to, and if you go this route, then definitely check some of the stuff that’s pretty powerful, lightweight plugin. But for this demo, just go up to add new next to snippets give it a title. For lack of imagination, that’ll work for me, I should probably spell this properly. But who’s keeping tabs and in the code box, paste this code, click on save changes.

And you can see there’s some additional options down here. But the default settings just fine. You can throw in a description and tags. And I’ll let you work on that stuff for later. But this is all you really need title, add code, save changes, click on activate. And that’s it. We’re done. Let’s go on back to our private browser again. Actually, let’s close this one out and do this again with a different one. That way none of this stuff’s can be cached in the browser, then paste that URL in here. Now just to give you a quick heads up, what this code does, is it redirects anything looking for author to the main page. So you see it does not display any username at all. It simply redirects the person looking for author no matter what ideas after that to the main page.

So again, this is just one more method in which you can hide the admin username from potential hackers. Well, that’s going to bring us to the end of this class on another alternative method of hiding your admin username from hackers. Thanks for checking it out and you have a great day.