def _escape_wildcard(search_query):
    """ Escapes the wildcards found in the given search query so that they are treated as *characters*
      rather than wildcards when passed to a LIKE or ILIKE clause with an ESCAPE '!'.
  """
    search_query = (
        search_query.replace("!", "!!").replace("%", "!%").replace("_", "!_").replace("[", "![")
    )

    # Just to be absolutely sure.
    search_query = search_query.replace("'", "")
    search_query = search_query.replace('"', "")
    search_query = search_query.replace("`", "")

    return search_query