Make WordPress Core

Opened 3 years ago

Last modified 2 years ago

#54240 new defect (bug)

WP REST API Users Endpoint Search

Reported by: damianem's profile damianem Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version: 5.8.1
Component: REST API Keywords: has-patch reporter-feedback
Focuses: rest-api Cc:


The WP REST API Users endpoint doesn't support plus addresses when searching using the search parameter - /wp-json/wp/v2/users/?search=example+label@…

Plus addressing is a handy Google Workspace and Office 365 feature that I'm noticing adoption of more and more.

Attachments (1)

54240.diff (717 bytes) - added by sabbirshouvo 2 years ago.
add urlencode for user search rest api param value

Download all attachments as: .zip

Change History (6)

#1 @swissspidy
3 years ago

Have you tried properly encode the email address because of the plus sign? e.g. ?search=example%2Blabel...

#2 @sabbirshouvo
2 years ago

@swissspidy I think you got it wrong. Plus addressing is like adding a random string to your email following by a + before @tld and still getting the email delivered in the original email address. For example my email is, a plus address can be like

@damianem users in wordpress should have a valid email address. Also I don't see any valid reason to adopt plus addressing support rest-api use fetching.

@swissspidy for automatically encoding search param value we can urlencode the input value. I'll add a patch for that.

2 years ago

add urlencode for user search rest api param value

#3 @swissspidy
2 years ago

I know what plus addressing is.

What I am saying is @damianem should urlencode the email address in their code/browser before making the REST API request.

Because if you don't do that, the plus sign in /wp-json/wp/v2/users/?search=example+label@… might be interpreted as a space character.

#4 @sabbirshouvo
2 years ago

  • Keywords has-patch added

#5 @swissspidy
2 years ago

  • Keywords reporter-feedback added
Note: See TracTickets for help on using tickets.