Source Lens – Code Finder
·
Source Lens – Code Finder is the ultimate code search tool for WordPress. It helps developers and site owners locate where any code lives in their Wor …
Source Lens – Code Finder is the ultimate code search tool for WordPress. It helps developers and site owners locate where any code lives in their WordPress installation – whether it’s in theme files, plugin files, the database, or even dynamically injected by other plugins.
Two Powerful Search Modes
1. Find Code/Strings – Search for any text, function, hook, shortcode, or code snippet inside files. Perfect for finding where a specific piece of code is used.
2. Find File by Name – Search for files by their name (e.g., header.php, functions.php, style.css) and view their full source code instantly.
Key Features
- Search Everywhere – Search across themes, plugins, WordPress core, and the database
- View Full Source Code – Find any file by name and view its complete source code
- Find Dynamically Injected Code – Detects code added by other plugins (like Google Tag Manager scripts from code snippet plugins)
- Multiple Search Types – Auto-detect, text string, function, hook, shortcode, class, regex, constant, CSS, and HTML
- Page Builder Support – Search inside Elementor, Divi, Beaver Builder, and Gutenberg blocks
- WooCommerce Support – Search products, orders, settings, and WooCommerce-specific data
- Code Snippets Detection – Finds code stored in popular snippet plugins (WPCode, Code Snippets, Insert Headers and Footers, etc.)
- Safe & Read-Only – Never modifies any files on your server
Short Description
Find where code lives in WordPress. Search functions, hooks, shortcodes and strings across themes and plugins.
How to Use
Finding Code or Text Strings
- Go to Tools → Source Lens – Code Finder
- Make sure « Find Code/Strings » mode is selected (default)
- Enter your search query. Examples:
add_action– Find all uses of the add_action functionwp_enqueue_script– Find where scripts are enqueuedGTM-XXXXXX– Find your Google Tag Manager container ID[contact-form]– Find where a shortcode is used- Any text or code snippet you want to locate
- Choose a Search Type (Auto Detect works for most cases)
- Choose a Search Scope (Everything, specific theme, specific plugin, etc.)
- Click Search to find all matches
Finding Files by Name
- Go to Tools → Source Lens – Code Finder
- Click « Find File by Name » mode
- Enter a file name. Examples:
header.php– Find all header.php filesfunctions.php– Find all functions.php filesstyle.css– Find all style.css fileselementor– Find all files with « elementor » in the name
- Click Search to see matching files
- Click « View Source Code » on any file to see its full contents
Advanced Options
- Case Sensitive – Match exact letter casing
- Whole Word – Only match complete words
- Regex Mode – Use regular expressions for complex patterns
- Search Encoded – Find base64 encoded content
- Search Runtime – Find dynamically injected code from other plugins
