Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4114476
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T22:27:37+00:00 2026-05-20T22:27:37+00:00

I have code that takes the name of a term and pulls in a

  • 0

I have code that takes the name of a term and pulls in a post of a custom post type of the same name. This works well. Except when a £ character is in the title.

e.g. pseudocode

$q = new WP_Query (array( 'name' => "Insurance Rating £1K"));
if($q->have_posts()){
    // expected path of logic flow
} else {
    // nothing was found =s
}

This post does indeed exist, yet it is not found, and this problem only affects cases with a ‘£’ character in the title. Since WordPress already sanitizes the titles etc, what is happening? Why does this not work?

edit:

This is a general case, not specific to any codebase of mine. I want to know why this happens and how to avoid it, the codebase this first arose in is irrelevant. So I dont need an alternative solution, as I’m looking for Why it happened

edit 2:

The database tables are using utf8_general_ci encoding.

The £ character is also being saved as is, not as a html entity, here’s a screenshot from phpmyadmin:

Database row

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-20T22:27:38+00:00Added an answer on May 20, 2026 at 10:27 pm

    What encoding is your PHP file in, and does it match the encoding of the database? They need to match for this to work. (Check your IDE or this link provided by @Tom)

    Failing that, make sure that the character isn’t a £ entity instead of the literal character.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

So I have this code that takes care of command acknowledgment from remote computers,
I have code that looks like the following, which works fine for displaying the
Following on from this question I now have code that can attach to a
Right now, I have code that looks something like this: Private Sub ShowReport(ByVal reportName
I am querying information from Active Directory . I have code that works, but
I have a piece of code that takes several rows from a database and
I have this code that makes sure your are logged in, and then making
I have to take over and improve/finish some code that transforms Java objects from
We have taken over some .NET 1.1 Windows Service code that spawns threads to
I have code that references a web service, and I'd like the address of

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.