• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
NameHero® Blog

NameHero® Blog

Web Hosting Tips & Resources From NameHero

  • Hosting
    • Web Hosting
    • WordPress Hosting
    • WooCommerce Hosting
    • Enterprise Hosting
  • VPS
    • VPS Hosting
    • Flex VPS
  • Reseller
  • Email
  • Gaming
  • Domains
  • Website Builder
  • Account
  • Blog Home
  • Categories
  • Authors

When Is It OK To Modify WordPress Plugins And Themes?

Bhagwad Park

Published on: May 20, 2020

Categories: WordPress 0

When you start delving a little more deeply into WordPress and want to customize things beyond what is offered by default via the GUI customization options, you enter the world of modifying code to suit your needs. At this point, it’s important to do things correctly. Every WordPress site tells you to be careful and follow these best practices:

  1. Never modify core WordPress code
  2. Always create child themes
  3. Contact the plugin developer for code changes

This is excellent advice. And for the overwhelmingly large part of your WordPress career, you would never actually manually change core code files. But are there situations where this might be necessary? Let’s take a look.

1. Modify Core WordPress Files – NEVER!

In my decade long experience with WordPress, I have never once found a reason to manually modify anything in the WordPress core code. Obviously, I’m not referring to custom plugins in the wp-content folder. I’m referring more to wp-includes, wp-admin, etc. These files contain fundamental functionality in WordPress and typically have nothing to do with display – only logic.

There was one situation I remember years ago, when I thought I would be forced to modify a WordPress core file. It had to do with thread indentation of comments. But in the end, I found a workaround involving a rewrite of the “Reply” link that I was able to encapsulate into a code snippet in functions.php. So I managed to avoid that as well.

Since then, I’ve never had a need to modify core WordPress files. Doing so is dangerous because not only will your changes get overwritten with the next update, it can likely have trickle down effects that you won’t anticipate.

2. Modifying Parent Theme Files – ALMOST Never

Just like the first one, you should avoid modifying main theme files directly. As much as possible, try and use the built-in options for modification. And if you need to make changes that are inaccessible via the theme options, you should create a child theme so that your modifications aren’t overwritten when the parent theme updates.

However, unlike with point 1, I can maybe see some situations where you can safely modify the parent theme. One possibility is that you yourself are the theme’s author! So you know exactly what you’re doing, and there’s no danger of an external update breaking your changes. A second situation might be when you know for a fact that the theme will no longer be updated. Maybe the theme’s author just isn’t active anymore, and you can safely make changes knowing that they will never be lost.

3. Modifying Plugin Files – Sometimes Necessary

The same caveat goes for modifying plugin files – your changes will be overwritten when the plugin updates. But unlike themes, there’s no concept of a “child plugin” since there’s no standard framework for WordPress plugin functionality. So if you want to change something, and the plugin author won’t take your suggestion on board, you have no option but to dig in yourself.

An example: Earlier, I’d written a tutorial on how to defer inline Javascript by changing the type to “module” from “text/javascript”. Unfortunately, much of my inline Javascript is a result of plugins outputting their code. I had no choice but to make the changes directly to the plugin code. One example, is the plugin for showing a Table of Contents via a shortcode. Luckily, this plugin no longer seems to be in active development, so there’s no danger of an update.

Other plugins however, still receive updates. So I maintain a separate notebook file where I list out the changes I’ve made to which files and I have to manually change them back every time one of these plugins gets updated. It’s tedious, but I’ve decided that the additional performance from deferring jQuery is worth it.

And there’s the rub. Modifying files like this always involves a cost in additional maintenance. You’ll have to decide for yourself whether or not the extra hassle is worth it. It often isn’t. But when necessary, you must do so carefully.

Bhagwad Park Profile Picture
Bhagwad Park

I’m a NameHero team member, and an expert on WordPress and web hosting. I’ve been in this industry since 2008. I’ve also developed apps on Android and have written extensive tutorials on managing Linux servers. You can contact me on my website WP-Tweaks.com!

Related Posts

How To Change The WordPress Featured Image Size (3 Ways)

In this post, we'll take a closer look at featured images in WordPress. We'll show you how to set them in your posts and pages and more!

WordPress SEO Services: What Are They?

If you’re looking to capture website traffic from search engines, you’ve probably come across the term SEO (short for Search Engine Optimization). However, if you’re completely new to SEO, you might not fully understand the concept or know how to implement these techniques. That’s why it can be a good idea to utilize WordPress SEO […]

How to Protect Your WordPress Website from Hackers

Learn how to protect your WordPress website from hackers with real-time malware protection, brute force prevention, and advanced firewalls. Discover how NameHero’s CloudShield can secure your site automatically and keep your business safe.

How to Clear the Cache in WordPress (3 Ways)

In this beginner friendly post, we'll take a closer look at caching and discuss when and how to clear your WordPress cache.

Reader Interactions

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Primary Sidebar

Follow & Subscribe

Exclusive promos, content and more!


Most Popular Posts

NameHero’s Recommended WordPress Plugin and Theme Setup (2024)

WordPress Hosting vs. Web Hosting – What’s The Difference?

How To Increase The InnoDB Buffer Pool Size

How To Fix A Stuck All-in-One WP Migration Import

How To Add A Subdomain In Cloudflare

Top Categories

  • WordPress
  • WordPress Tutorials
  • Enterprise Hosting
  • WooCommerce
  • Web Hosting
  • Resellers
  • Website Security
  • Website Development
  • Website Performance
  • VPS Hosting
  • SEO Tips
  • Announcements
  • Domain Registration
NameHero

NameHero® proudly provides web hosting to over 40,000 customers with 99.9% uptime to over 750,000 websites.

  • Master Card
  • Visa
  • American Express
  • Discover
  • Paypal
Products
  • Web Hosting
  • VPS Hosting
  • Flex VPS Hosting
  • WordPress Hosting
  • WooCommerce Hosting
  • Reseller Hosting
  • Enterprise Hosting
  • Email Hosting
  • Game Hosting
  • Domains
  • Website Builder
Help & Support
  • NameHero Blog
  • NameHero Gaming Blog
  • Support
  • Help Center
  • Migrations
  • Affiliates
  • Gaming Affiliates
  • Call 1-855-984-6263
Company
  • About Us
  • Contact Sales
  • Reviews
  • Uptime
  • We're Hiring

Copyright © 2025 Name Hero, LLC. All rights reserved.
NameHero® is a registered trademark.

  • Privacy Policy
  • Terms of Use
  • Acceptable Use Policy
  • Payment Policy
  • DMCA