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/'

 

 



Written by: Jake Lett
Jake Lett is a B2B marketing consultant with over 15 years of experience in the digital marketing industry. He specializes in SEO, HubSpot, and PPC campaign management. Jake has a proven track record of helping businesses increase their online visibility and drive more traffic, leads and sales. He is a Certified Google Ads Specialist and a Certified HubSpot Developer.

Related posts

Tags: ,

Want to Get Email Updates of New Articles?

Join My Email Newsletter