admin管理员组文章数量:1434924
I am having a line of code in my header that I can't seem to find where it is coming from, checked both files and database, am sure am missing something, are you guys aware of any methods to find for pieces of code where they are called from ?
Kind regards, Cristian
I am having a line of code in my header that I can't seem to find where it is coming from, checked both files and database, am sure am missing something, are you guys aware of any methods to find for pieces of code where they are called from ?
Kind regards, Cristian
Share Improve this question edited Apr 2, 2019 at 11:12 fuxia♦ 107k39 gold badges255 silver badges459 bronze badges asked Apr 1, 2019 at 12:13 Cristian TrandafirCristian Trandafir 11 bronze badge 6 | Show 1 more comment1 Answer
Reset to default 0Install the String Locator WordPress plugin (free): https://wordpress/plugins/string-locator/
You can then search through all the files on your server, looking for google-analytics
and do some inspection on the files found to see if any of those are the culprit. Chances are it's hard coded in your theme header files, or there's a plugin that's enqueuing the script.
You can also use a DB search and replace plugin, just set config to do a "dry run" to search for google-analytics
to see if it's saved in the db anywhere:
https://wordpress/plugins/search-and-replace/
I would also recommend that you try using a different browser as well to check this, to make sure some Chrome (or whatever browser you're using), that an extension is not injecting that on the page.
本文标签: themesHow to find file that placed a line in my header
版权声明:本文标题:themes - How to find file that placed a line in my header 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1745635708a2667544.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
<head>
- I thought you meant HTTP headers. But the advice about changing theme and plugins stands. If this script tag isn't in your theme then it'll be a plugin hooking wp_head and writing it; you could try removing thewp_head()
call from your theme to see if that removes the script tag, else you'll have to search through everything that hooks wp_head to see which one is doing it. – Rup Commented Apr 1, 2019 at 16:36grep
:grep -rn 'www.google-analytics'
will return the files and lines containing the string "www.google-analytics" – phatskat Commented Apr 1, 2019 at 18:02