I am working on a legacy code where part of the website uses WP and other part ASP etc. Is there an easy way to tell me what content is coming from WP vs Non-WordPress? Since the codebase is large this can help me understand the flow of information.
I am working on a legacy code where part of the website uses WP and other part ASP etc. Is there an easy way to tell me what content is coming from WP vs Non-WordPress? Since the codebase is large this can help me understand the flow of information.
Share Improve this question edited Oct 19, 2020 at 9:15 cjbj 15k16 gold badges42 silver badges89 bronze badges asked Oct 19, 2020 at 9:07 DavidDavid 1032 bronze badges 02 Answers
Reset to default 2This depends very much on you setup and how you want to be able to see this.
If you look in the source code of a page, you are very likely to be able to see which page is WP generated, because there will be strings like wp-content
and wp-includes
present (for instance because jquery
is loaded by default). You could also add a specific code to the head of your site like this:
add_action ('wp_head','wpse376765_add_code');
function wpse376765_add_code () {
echo '<meta name="wpmademe">';
}
If you want it to be visible in the page itself, the easiest way would be to attach a little marker for admins only by including this in the functions.php
of your theme:
add_action ('wp_footer','wpse376765_add_code_to_footer');
function wpse376765_add_code_to_footer () {
if (is_admin()) echo '<span>WP made me</span>';
}
WordPress outputs a generator meta tag using the the_generator()
function, that you can use to identify it.
For example, WordPress sites have this:
<meta name="generator" content="WordPress" />
https://www.metatags/all-meta-tags-overview/meta-name-generator/
Note that some themes/plugins remove this tag as it has no practical use for most developers and no SEO benefit