Search result not finding text strings that should be there?
-
Hi all,
Using Notepad++ to find text strings within a Wordpress theme to edit. So I have taken a complete backup of my site. Unzipped it and placed it in a folder on desktop. I know which text I want to edit (there’s a few strings) and apart from one line of text Notepad is finding them all. So I am stuck here, I can see the line of text on a page on my site, Notepad is finding similar lines of text from the same page but not one line in particular. Does anyone have any idea this would happen?
PS: I’m a not a developer ;)
Cheers
-
No one will be able to help you, with only that level of detail provided.
Say more…show screenshots…basically do anything to provide more info.“Notepad” is a Microsoft application – hopefully you are talking about Notepad++…
Wordpress theme…placed it in folder on desktop…are all irrelevant things, so you don’t have to expound on those.
-
@CaspersDad said in Search result not finding text strings that should be there?:
I can see the line of text on a page on my site, Notepad is finding similar lines of text from the same page but not one line in particular. Does anyone have any idea this would happen?
Most likely the text looks the same when rendered on a web page, but the source is different, white space being the most likely difference. For example, absent specific styling instructions to the contrary, all these will appear the same on a web page:
This is the text.
This is the text.
This is the text.
This is the text.
<span id="marker1">This</span> is the text.
Those are all different to a Notepad++ search, but they look the same on a web page.
-
Thank you both for the replies. Just to confirm I am using Notepad++ for searching not Notepad.
I have taken a screenshot of what I am talking about.
@Coises If this is the case would Notepad++ not be able to find what I am looking for?
Many thanks
-
There is no way that the screenshot you provided helps in any way.
When I mentioned screenshots, I meant of Notepad++ and what you are doing/seeing there. -
@CaspersDad said in Search result not finding text strings that should be there?:
@Coises If this is the case would Notepad++ not be able to find what I am looking for?
It depends on the markup. Try just searching for
displayed?
, as that’s not going to have any newlines or other whitespace between, and is less likely to have markup tags in the middle. (Thoughdisplayed?
anddis<span></span>played?
anddisplayed?
are all valid ways of sayingdisplayed?
in HTML. So it’s not foolproof.)BTW: the answer to how to search for plain text inside HTML is a generic answer, not specific to Notepad++: in general, because of the way that HTML can have tags between visible text, doing any multi-word search in the source code for a multi-word phrase runs into the danger of markup tags or whitespace differences meaning you cannot find it – whether you are searching with Notepad++, notepad.exe, VS Code, or vi. There is no simple way to search for the text as you see it rendered on a webpage, because the text is not the only thing in HTML – the markup is the bulk of it. In general, my recommendation is to only search for single words at a time when searching markup. (Or use an application or tool designed to search rendered markup – like a browser or WYSIWYG editor, or see if any of the HTML plugins for Notepad++ allow searches to ignore spaces and markup [I don’t know; I don’t use the HTML plugins for Notepad++]).
Essentially, until you understand HTML, you will not be able to do an effective search using any tool, but you might get away with single-word searches, like I suggested. So your excuse of “I’m not a developer” is going to cause you to fail until you choose to be willing to learn. Good luck.
-
@CaspersDad said in Search result not finding text strings that should be there?:
If this is the case would Notepad++ not be able to find what I am looking for?
Probably it won’t be able to do that.
Especially now that I see the sort of page under consideration… it’s possible that “Where do you want your auction displayed?” isn’t even in the HTML file for the page at all — it might be inserted by scripting, either server-side or client-side, so that it changes when conditions change (maybe changing to “Your auction will be displayed in:” once the user has made a choice).
If this is a generic question as to being able to search web pages in Notepad++, the answer is, “It depends; it will sometimes be useful, it will never be 100% reliable.” If you have a specific use case, we might be able to help, but more likely you will need to consult with someone who understands the framework behind these web pages to get useful advice.