How to Find Out What WordPress Theme a Site Is Using
Every WordPress theme has to ship a file called style.css with a comment block at the top that names the theme, its author and its version. WordPress reads that block to list the theme in the dashboard, and because the stylesheet is loaded by every visitor’s browser, anyone can read it too. That one requirement is why you can usually find out what WordPress theme a site is using in under a minute.
This guide does it by hand first, with the page source and three short commands, so you know what the evidence looks like. Then it covers child themes, plugins, and the cases where a site reveals nothing. You need a browser, and a terminal with curl if you want to follow the commands.
From experience · Md. Zubaer Ahammed
When I look at a site an agency built, the first theme folder I find is very often a child theme carrying the client’s name. Searching for that name leads nowhere. So I open the child’s style.css first and read the Template line, because the parent is the theme I can actually look up.
The theme folder is in the page source, and style.css names the theme
Open the site, view the page source (Ctrl+U, or Cmd+Option+U on a Mac) and search for wp-content/themes/. The word that follows is the theme’s folder name. From a terminal, the same search counts how often each folder appears:
curl -s https://example.com/ | grep -o 'wp-content/themes/[^/"]*' | sort | uniq -c On this site, wptutshub.com, it prints:
2 wp-content/themes/techblaze 3 wp-content/themes/techblaze-child-theme One folder usually dominates. A second one is often the parent of a child theme, which a later section explains. The folder name is only a slug, so ask the theme to introduce itself by fetching its stylesheet:
curl -s https://example.com/wp-content/themes/northwind/style.css | head -n 20 A theme’s stylesheet opens with a header like this one, shown here for a made-up theme called Northwind:
/* Theme Name: Northwind Theme URI: https://example.com/themes/northwind/ Author: Example Studio Description: A fast, lightweight theme for blogs, shops and business sites. Version: 2.4.1 Requires at least: 6.4 Requires PHP: 7.4 License: GNU General Public License v2 or later Text Domain: northwind */ Theme Name is the name shown in the dashboard and on the theme’s sales or directory page. Theme URI and Author tell you where it comes from. Version is what the file claims; a site owner can edit or strip that line, so read it as a published claim and not as proof of what is running. Text Domain normally matches the folder name and is a good search term when the theme name is generic.
The ?ver= number on a file is often not the theme’s version
While you are in the page source you will notice that most stylesheet and script addresses end in a query string such as ?ver=6.8.2. It is tempting to read that as the theme’s version, and it is frequently something else.
curl -s https://example.com/ | grep -o 'themes/[^"]*\.css?ver=[^"]*' WordPress adds ver to every file a theme or plugin registers, so browsers fetch a fresh copy after an update. When the developer passes a version, that is the number you see. When they pass nothing, WordPress fills in its own core version, so a theme file can carry the version of WordPress itself. Some themes put a timestamp there on purpose. On this site the parent stylesheet is requested as themes/techblaze/style.css?ver=1.1.6, and in this case the number does match the parent theme’s version. Trust the Version line inside style.css, and use ?ver= only as a hint.
A Template line means you are looking at a child theme
Developers rarely edit a bought theme directly, because the next update would overwrite their changes. They create a child theme: a small folder that holds their own styles and templates and borrows everything else from a parent. This site’s own stylesheet is a real example:
/* Theme Name: WP Tuts Hub Theme URI: https://wptutshub.com/ Description: Modern child theme for TechBlaze — WP Tuts Hub redesign. Author: Md. Zubaer Ahammed Author URI: https://zubaer.com/ Template: techblaze Version: 2.0.0 Text Domain: wptuts-hub */ The line to look for is Template, which an ordinary theme does not have. It holds the parent’s folder name, here techblaze, and that explains the two folders in the earlier output. When you see it, much of the structure you are looking at is the parent’s work, so fetch /wp-content/themes/techblaze/style.css as well. A child theme’s name is often the agency’s or the client’s own, which is why searching for it finds nothing: the product you could install yourself is the parent.
Plugins show up the same way, but only the ones that load on that page
Plugins that add something visible to a page load their own scripts and styles from /wp-content/plugins/, so the same search works with one word changed:
curl -s https://example.com/ | grep -o 'wp-content/plugins/[^/"]*' | sort -u Each line is a plugin’s folder name. For a plugin from the WordPress.org directory, that name is also its address: contact-form-7 lives at wordpress.org/plugins/contact-form-7/. Directory plugins include a readme.txt, and its Stable tag line shows the version the author last released, which is close to, though not always the same as, the version installed:
curl -s https://example.com/wp-content/plugins/contact-form-7/readme.txt | grep -i 'stable tag' Keep the limits of this in mind. The list covers the page you fetched and nothing else. A plugin that only works in the dashboard, such as a backup or security plugin, loads nothing for visitors and stays invisible. A shop’s checkout plugins appear on the checkout page and may be absent from the homepage. A folder name with no match on WordPress.org usually means a premium or custom-built plugin. The same search on this site prints no plugin folders at all, although several plugins are active: nothing they load on the homepage comes from a plugin folder.
Two quick checks tell you whether the site runs WordPress at all
If the search for wp-content finds nothing, check whether you are looking at WordPress before digging further. WordPress announces its REST API in a response header and in the page source, and many sites still print a generator tag:
curl -sI https://example.com/ | grep -i '^link:' curl -s https://example.com/ | grep -i 'name="generator"' A Link header that ends in rel="https://api.w.org/" is the REST API discovery link, and it is hard to explain on a site that is not WordPress. The generator tag, when present, names WordPress and often a page builder as well. The REST API itself will not tell you the theme: the /wp-json/wp/v2/themes endpoint answers only to logged-in users who are allowed to manage themes.
What a theme detector does for you, and what it cannot see
A detector runs the same steps for you and reads the answers back in a tidy form. The free WordPress theme detector on Zubaer Tools reads the homepage, finds the theme folder, fetches that theme’s style.css and shows the name, version, author and screenshot, with the parent theme when there is one. It also lists up to 20 plugins whose files appear on the homepage, linked to WordPress.org where the folder matches, and it shows which file led to each finding so you can check it yourself.
No detector can do more than the page allows. It sees the homepage only, so plugins used on other pages or only in the dashboard do not appear. It reports the version the stylesheet publishes, which may have been edited. It cannot tell you about security problems, and it cannot identify a theme whose files are hidden. When a site turns out not to be WordPress, a general technology lookup is the better starting point, because it looks for other platforms and frameworks too.
Why some sites show nothing: bundled files, renamed paths and builders
Several things can leave you with an empty result or a misleading one.
- A custom theme. Agencies often build one theme for one client. You will find a folder and a header, but the name leads nowhere because the theme was never sold. The author line may name the agency, which is still useful.
- A page builder doing the design. On sites built with Elementor, Divi or a similar builder, the theme can be a deliberately plain one such as Hello Elementor, and the layout you see lives in the builder. The plugin list and the generator tag reveal the builder.
- Combined or relocated files. Performance plugins merge stylesheets into one cached file, and some sites serve assets from a separate host. The theme folder may then be missing from the source even though the site is ordinary WordPress. Search the source for
themes/on the asset host as well. - Renamed paths. Security plugins can rewrite
wp-contentto another name to hide WordPress. The REST API link and the generator tag sometimes survive, and sometimes nothing does. - A headless site. When WordPress is used only as a content store behind a JavaScript front end, visitors never load the theme at all, and there is nothing to find.
My tip · Md. Zubaer Ahammed
Before you trust any detector, including mine, run the first curl command on your own site. It takes a few seconds and shows exactly what a stranger can read about your theme and its version. If that version is an old one, update the theme.
Found the theme? Look it up before you copy anything
Once you have the theme’s name, search for it on wordpress.org/themes/ first: if it is there, it is free to install and you can see how recently it was updated and how many sites use it. If it is a premium theme, the Theme URI leads to the seller. Either way, buy or download the theme itself; do not copy another site’s stylesheet or templates, which belong to whoever built them and will not work without the settings behind them.
The useful next step is to run the same commands against your own site. You will see exactly what you publish: your theme, its version, and the plugins that load on your homepage. If the version shown there is an old one, updating the theme protects you far more than hiding the number does.
Official reference: the Theme Handbook’s pages on the main stylesheet (style.css) and on child themes list every header field and explain how a child theme finds its parent.
Originally published on WP Tuts Hub.
原文:https://www.a8q9.cn/en/article/how-to-find-out-what-wordpress-theme-a-site-is-using-ecad09.html