title: How to create a script to check the website is using WordPress?
body: <p>I'm trying to create a simple script that'll let me know if a website is based off WordPress. </p>
  
  <p>The idea is to check whether I'm getting a 404 from a URL when trying to access its wp-admin like so:</p>
  
  <p><code>https://www.audi.co.il/wp-admin</code> (which returns "true" because it exists)</p>
  
  <p>When I try to input a URL that does not exist, like "<a href="https://www.audi.co.il/wp-blablabla" rel="nofollow noreferrer">https://www.audi.co.il/wp-blablabla</a>", PHP still returns "true", even though Chrome, when pasting this link to its address bar returns 404 on the network tab. </p>
  
  <p>Why is it so and how can it be fixed?</p>
  
  <p>This is the code (based on another user's answer):</p>
  
  <pre><code>&lt;?php 
  
  $file = 'https://www.audi.co.il/wp-blabla';
  $file_headers = @get_headers($file);
  if(!$file_headers || strpos($file_headers[0], '404 Not Found')) {
      $exists = "false";
  }
  else {
      $exists = "true";
  }
  echo $exists;
  </code></pre>