How to Quickly Search for a Code Text String on Entire WordPress Website


How to Quickly Search for a Code Text String on Entire WordPress Website

I recently was trying to optimize my WordPress site performance and noticed a javascript error saying jQuery is not defined. Basically, there was a script that was loading before jQuery was loaded. I searched my entire theme but could not find the code. I then thought of searching all of my plugins for the code. I tried downloading my site and it was taking forever to download the files.

Then I thought, I wonder if this could be done on the server in Cpanel. I then found this article with an SSH command to search all contents of a folder. I am not a terminal wiz and didn’t want to take the time to setup Putty so then found you can access the terminal inside of Plex Cpanel.

Below is the command I ran in the terminal to find the string I was looking for. In my case it was '.add_to_cart_button:not(.product_type_variable, .product_type_grouped)'

The terminal command
grep -Ri 'your string' 'public_html/your-folder/'

 

 


About the Author

Jake Lett is a results-driven Detroit based B2B marketing consultant with 15+ years of hands-on experience managing SEO and PPC campaigns across manufacturing, SaaS, and professional services industries. He’s a Certified Google Ads Specialist and HubSpot CMS Developer who has personally managed budgets ranging from $500 to over $10,000/month.

Jake specializes in helping small businesses and solo marketers get more from lean ad budgets—using practical strategies that drive qualified leads, not just traffic. He shares real-world lessons on his blog, YouTube channel, and in his published books on digital marketing.



Related posts

Tags: ,

Want to Get Email Updates of New Articles?

Join My Email Newsletter