Search code examples
phphtmlwordpressstorefrontchild-theming

How to remove a part of an html code inside of a php?


I was trying to remove a "Search" button on the top left corner of a web site.

After searching here I found a tip here: Best way to find out which php file has generated an html line of code in WordPress

But still after installing the plugin I could not be able to locate the desired html line to simply erase it. Also tried using the css code above to temporary hide it.

.pesquisar {
display: none !important;
}

It did not work. Can somebody help me on how can I erase <button type="submit" value="Pesquisar">Pesquisar</button> from the html code?


Solution

  • I just found a great solution.

    To anyone in need to find a specific part of an html code there is a plugin called String Locator: https://br.wordpress.org/plugins/string-locator/

    It allows you to find across any file and regex. Ideally the plugin allows editing after identifying the file, but because I was using security plugins I got an error.

    Desipte that the path of the located file is shown, so I was able to manually get to the located file and change it.

    Another tip is if your file identified with the string plugin is located in a cache folder like it was in my case I recommend cleaning the cache using plugins such as autoptimize or wp fastest cache then do the search again.

    When I did there was only one file that remains needing an edit, good luck!