Title: Excluding query string with question mark
Last modified: April 27, 2020

---

# Excluding query string with question mark

 *  [eWallz](https://wordpress.org/support/users/archonic08/)
 * (@archonic08)
 * [6 years, 1 month ago](https://wordpress.org/support/topic/excluding-query-string-with-question-mark/)
 * hi, i’m trying to exclude a few request query mostly from wocommerce but keep
   on getting error question mark cannot be specify in request uri.
 * `You may not specify the query string with a question mark: {\/\?wc-ajax=get_refreshed_fragments
   $}`
 * followed this guide here: [https://wpcerber.com/antispam-exception-for-specific-http-request/](https://wpcerber.com/antispam-exception-for-specific-http-request/)
 * but your example does not have (?)

Viewing 4 replies - 1 through 4 (of 4 total)

 *  Thread Starter [eWallz](https://wordpress.org/support/users/archonic08/)
 * (@archonic08)
 * [6 years, 1 month ago](https://wordpress.org/support/topic/excluding-query-string-with-question-mark/#post-12741068)
 * will these regex serve my purpose to exclude all request that contains these 
   string within the url?
 * to exclude all woocommerce ajax cart request
    `{wc-ajax=get_refreshed_fragments}`
 * to exclude/bypass all api & callback request from paypal payment (specific for
   paypal only)
    `{wc-api=WC_Gateway_Paypal}`
 * to exclude/bypass any request to woocommerce api (generic)?
    `{wc-api}`
 * really need this because my website got many external request from plugins & 
   external service such as payment gateways, etc. Instead of setting up specific
   regex for longer url can I just do the above with broader coverage yet still 
   specific to certain strings within the queried url?
 *  Plugin Author [gioni](https://wordpress.org/support/users/gioni/)
 * (@gioni)
 * [6 years, 1 month ago](https://wordpress.org/support/topic/excluding-query-string-with-question-mark/#post-12744134)
 * If you’re asking about the anti-spam exceptions, please read the updated article:
   [https://wpcerber.com/antispam-exception-for-specific-http-request/](https://wpcerber.com/antispam-exception-for-specific-http-request/)
 * P.S. A bug related to this setting field has been discovered and fixed in v 8.6.3.
   Install the latest version of WP Cerber cause the bug might affect your configuration.
 *  Thread Starter [eWallz](https://wordpress.org/support/users/archonic08/)
 * (@archonic08)
 * [6 years, 1 month ago](https://wordpress.org/support/topic/excluding-query-string-with-question-mark/#post-12805918)
 * hi [@gioni](https://wordpress.org/support/users/gioni/) thanks for the reply.
 * Im refering to the Anti-Spam & Traffic Inpector modules. I just need your confirmation
   whether i’m using the correct input for whitelisting the query/request below:
 * Anti Spam (no regex) – to exclude any query from Paypal payment
 * `wc-api=WC_Gateway_Paypal`
 * Traffic Inspector – to whitelist all request of paypal payment
 * `{wc-api=WC_Gateway_Paypal}`
 * are the above input for each module correct?
 *  Plugin Author [gioni](https://wordpress.org/support/users/gioni/)
 * (@gioni)
 * [6 years ago](https://wordpress.org/support/topic/excluding-query-string-with-question-mark/#post-12869150)
 * In your case you don’t need to use REGEX at all. Plus you forget the slash. Here
   is what you need to use for the Query whitelist in the Anti-Spam settings.
 * `/?wc-api=WC_Gateway_Paypal`

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘Excluding query string with question mark’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/wp-cerber_77a9bf.svg)
 * [WP Cerber Security, Anti-spam & Malware Scan](https://wordpress.org/plugins/wp-cerber/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wp-cerber/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wp-cerber/)
 * [Active Topics](https://wordpress.org/support/plugin/wp-cerber/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wp-cerber/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wp-cerber/reviews/)

## Tags

 * [paypal](https://wordpress.org/support/topic-tag/paypal/)
 * [wocommerce](https://wordpress.org/support/topic-tag/wocommerce/)

 * 4 replies
 * 2 participants
 * Last reply from: [gioni](https://wordpress.org/support/users/gioni/)
 * Last activity: [6 years ago](https://wordpress.org/support/topic/excluding-query-string-with-question-mark/#post-12869150)
 * Status: not resolved