Home » How To Find Which File To Edit In WordPress Theme

How To Find Which File To Edit In WordPress Theme

How To Find Which File To Edit In A WordPress Theme

Do you find yourself wasting so much time trying find which file to edit in WordPress themes? If this applies to you, this article will tell you how to find which file to edit in any WordPress theme.

We all know how annoying and time-consuming trying to insert whatever code in different files, hoping to see it on the front-end. So let’s cut out the ‘trial and error’ bit when searching for whatever theme file that needs editing.

No matter what WordPress theme you’re using, finding the file to edit is very simple. All you need to do is to install the What The File plugin. This is a great tool for any developer, web designer or anybody needing to make customizations to a WordPress theme. Once you’ve used this plugin, you’ll never touch a line of code again without it.

Find Which File To Edit In WordPress Theme

Installing the What The File plugin is done as like installing any regular plugin in WordPress. Once you have installed it, you’ll find the name of the theme template that’s active at any time. To identify what template to edit, you’ll now find a welcome drop-down on in your admin bar. You will just need to be logged-in to see it on the front-end of your website.

Do be careful however, when using this plugin. other logged-in users will also be able to see the what theme files are active in the admin bar. This is not just other admin users, it’s also users on the ‘Subscriber’ role and all other roles. This is really the only downside to this plugin, so installing this plugin on a development site is advised if you need to use it.

How To Find Which File To Edit In WordPress Theme

Locate The File To Edit In The WordPress Theme

The What The File plugin is great for finding and identifying the active file to edit in a WordPress theme. That being said, directly editing theme files is not really something you would want to be doing.

The plugin doesn’t only show you what active theme file to edit, it links it to the WordPress editor. You can simply press the file the plugin finds and clicking it, will take you straight to the editor. Even if you have a created a child theme, editing files on that has the potential of bringing your site down if you make any mistakes in the code. The best way around this is to be actually doing any editing on your development site.

To avoid making any edits on your theme or child theme files on the fly, make a copy of the theme to your had disk. Now, comes the next cool tool to help you find the WordPress theme file to modify. There are other similar tools but my favorite one is Agent Ransack and it’s free.

This cool tool lets you point its finder to the folder that you wish to find a fie in by file name. You’ll basically just need point the finder to the folder of your theme you’ve backed up on your hard disk and enter the name of the file. Agent Ransack will quickly find the file you need and give you its path in your theme folder. You can now safely make edits to the file and upload it to your development website. When you see that the modification you’ve made to any theme file works, upload the modified file to your live site.

Find Which File To Edit In WordPress Theme

Conclusion

We hope you’ve enjoyed this article and that struggling with trying find which file to edit in WordPress themes has become a thing of the past. The two free tools above are great help of you don’t know the hierarchy of the WordPress theme files. Please give us your feedback and we would also love to know if you’re using another method.

Leave a Reply