How to Disable File Editing in the WordPress Admin Panel

With an urge to secure the WordPress website, I always seek the possible ways to find a vulnerability and remove it.

There are many website owners, who are struggling to understand the WordPress CMS(Content Management System). I remember when I used to freak out, but not anymore.

If you scan your WordPress admin panel, you may find an option to edit your WordPress theme’s coding files, and so does for the plugins.

It’s possible that hackers can inject some malicious code to these files and the website may never be as it is now. It’s essential to stop such access directly to the coding files of your WordPress website through its admin area.

If you want to edit something, it’s better to use cPanel.

Let me show you a screenshot to find the editing option. Login to your WordPress admin panel, go to Appearance>>Editor, this editor option is to modify your WordPress theme code.

How to Disable File Editing in the WordPress Admin Panel

For plugins, go to Plugins>>Editor. You can see an example of the code editor below.

How to Disable File Editing in the WordPress Admin Panel

In this tutorial, you’re going to learn about removing these editors from the WordPress dashboard, so that even if someone hacks your website by brute force attack, they can’t mess up with the coding files.

Edit the wp-config.php File to Stop File Editing

The .htaccess and wp-config.php are the two most vital files of a WordPress site. In most of the cases, whenever you require to add or improve any functionality, you ought to use these files.

To remove the file editing option from the WordPress admin panel, you must use the wp-config.php file; I hope you know how to locate it.

Follow these steps.

Step 1

Open cPanel and look for the file manager
. As you know, the file manager consists of all of your websites’ data.

How to Disable File Editing in the WordPress Admin Panel

Even if you host multiple websites on your single web hosting server, you can easily find their core files and folders. Depending on the web hosting company you have, without getting confused with the design of cPanel, you should try finding the file manager and open it.

Step 2

Make sure you open the public_html directory, make people also call it a root directory.

If you see a blank page, navigate to the public_html from the vertical menu on the left side of the screen
.

How to Disable File Editing in the WordPress Admin Panel

Step 3

If you host only one website, you may find all the files and folders in the root directory
. If not, you may have to see another folder.

How to Disable File Editing in the WordPress Admin Panel

Search for the wp-config.php file by scrolling down and right-click to edit. You can also choose an Edit option from the main navigation menu of cPanel.

Step 4

Once you choose to edit, you can see a popup to confirm the editing of this file
. It’s a necessary step because cPanel authenticates your access.

How to Disable File Editing in the WordPress Admin Panel

Click Edit; a new tab opens in the browser.

Step 5

You can see a bunch of coding lines. Well, no need to be scared,

all you need is copy the code and paste
it at the bottom of all the other codes of the file.
define( 'DISALLOW_FILE_EDIT', true );

Click Save Changes from the top-right corner of the screen to save the file.

Now login again to the admin panel of your website and check if you see the Editor option for themes and plugins. If not, you have successfully disabled the file editing from WordPress dashboard.

How to Disable File Editing in the WordPress Admin Panel

From now onwards, no one will be able to edit the coding file of your WordPress themes and plugins, not even you.

If you want to modify something, it better to use cPanel. Nowadays, almost every web hosting company offers cPanel account, even with their starter plan.

Can You Now Stop Everyone from Editing the Coding Files through Website’s Dashboard

One of the best ways to start securing your website is from its admin panel. Millions of websites face havoc through the login page, which leads to malicious code injection to plugin and theme coding files.

The worst part is that it’s hard to fix a website when it’s hacked by injecting a bad code. There are tons of coding files on a plugin or a theme; you can’t go through all of them.

So why not take the initiative to remove the editor? I hope you can easily accomplish such a task.

Conclusion

Once in a while, a WordPress beginner asks the questions related to the website’s security, and I always recommend them to learn the basics.

Securing a WordPress site is easy only if you have a look at the possible vulnerabilities. I am sure, you can easily disable file editing from the dashboard.

Check out these top 3 WordPress hosting services:

HostArmada
$2.49 /mo
Starting price
Visit HostArmada
Rating based on expert review
  • User Friendly
    4.5
  • Support
    4.5
  • Features
    4.5
  • Reliability
    4.5
  • Pricing
    4.0
IONOS
$1.00 /mo
Starting price
Visit IONOS
Rating based on expert review
  • User Friendly
    4.5
  • Support
    4.0
  • Features
    4.5
  • Reliability
    4.5
  • Pricing
    4.3
Ultahost
$2.90 /mo
Starting price
Visit Ultahost
Rating based on expert review
  • User Friendly
    4.3
  • Support
    4.8
  • Features
    4.5
  • Reliability
    4.0
  • Pricing
    4.8

How to Block a Country from Your WordPress Website Using cPanel

This how-to guide explains the best possible way to block specific country users
3 min read
Arvind Singh
Arvind Singh
Hosting Expert

How to Stop Access to Sensitive Files of Your WordPress Website

This how-to guide explains to add another security layer to the sensitive files
3 min read
Arvind Singh
Arvind Singh
Hosting Expert

How to Disable the XML-RPC WordPress File Using cPanel

This how-to guide teaches you to disable the XML-RPC WordPress file to reduce th
3 min read
Arvind Singh
Arvind Singh
Hosting Expert

How to Block Hackers Using cPanel From Scanning Your Website's Authors

This how-to guide helps you understand the concept of protecting authors' names
3 min read
Arvind Singh
Arvind Singh
Hosting Expert
HostAdvice.com provides professional web hosting reviews fully independent of any other entity. Our reviews are unbiased, honest, and apply the same evaluation standards to all those reviewed. While monetary compensation is received from a few of the companies listed on this site, compensation of services and products have no influence on the direction or conclusions of our reviews. Nor does the compensation influence our rankings for certain host companies. This compensation covers account purchasing costs, testing costs and royalties paid to reviewers.
Click to go to the top of the page
Go To Top