Sanitizing is required when you are inserting user input into Database or outputting it in HTML etc. Here, you are simply doing a String comparison.
wp_verify_nonce
function checks $nonce
value like this:
if ( hash_equals( $expected, $nonce ) ) {
return 1;
}
For this you don’t need sanitizing. So the following is fine:
wp_verify_nonce( $_GET['some_nonce'], 'some_nonce' );
Related Posts:
- Should I sanitize an email address before passing it to the is_email() function?
- Escaping and sanitizing SVGs in metabox textarea
- What is the difference between wp_strip_all_tags and wp_filter_nohtml_kses?
- Reason for Lowercase usernames
- What is the best way to sanitize data?
- esc_url removes white space. Can I change that to using ‘-‘?
- WP Coding standards – escaping the inescapable?
- Sanitatizing when using the posts_where hook
- Escape hexadecimals/rgba values
- Must I serialize/sanitize/escape array data before using set_transient?
- Echo JavaScript Safely
- wp_kses ignore allowed and allow everything
- Sanitize array callback for the WordPress Settings API
- How to escape $_GET and check if isset?
- What’s a safe / good way to output HTML safely within WordPress templates?
- Do Not Understand → Rule No. 4: Making Data Safe Is About Context [closed]
- Sanitizing output that contains quotes?
- WP_Customize_Manager: How to get control ID
- How to use wp_filter_oembed_result?
- Sanitization html output itself
- Post text sanitization after publishing/editing – changes are not saved
- wp_set_object_terms() without accents
- Escaping data from database (users table) is necessary?
- Properly sanitize an input field “Name “
- Sanitize a custom date meta field
- What is the proper way to sanitize $_POST and $_GET vars?
- Why is sanitize_text_field() selectively trimming data?
- what is a good method to sanitize the whole $_POST array in php?
- wp_verify_nonce vs check_admin_referer
- Is sanitize_title enough to generate post slugs?
- Do I need a nonce field for every meta box I add to my custom post type admin?
- In Which Contexts are Plugins Responsible for Data Validation/Sanitization?
- wordpress sanitize array?
- Data sanitization: Best Practices with code examples
- How does nonce verification work?
- Can I use the same nonce for multiple requests on the same page?
- How safe / sanitized is wp_insert_posts()?
- Should HTML output be passed through esc_html() AND wp_kses()?
- When to use esc_html and when to use sanitize_text_field?
- How to get a unique nonce for each Ajax request?
- Nonce retrieved from the REST API is invalid and different from nonce generated in wp_localize_script
- Are Nonces Useless?
- How to safely sanitize a textarea which takes full HTML input
- How to use nonce with front end submission form?
- Sanitize and data validation with apply_filters() function
- Custom page with variables in url. Nice url with add_rewrite_rule
- Sanitize content from wp_editor
- How to properly validate data from $_GET or $_REQUEST using WordPress functions?
- What’s the difference between esc_* functions?
- Extend WordPress (4.x) session and nonce
- Nonces can be reused multiple times? Bug / Security issue?
- is_email() VS sanitize_email()
- Sanitizing integer input for update_post_meta
- How to expire a nonce?
- Sanitize User Entered CSS
- Which KSES should be used and when?
- How do WordPress Nonces Work?
- Is sanitize_text_field() is enough to save to DB?
- Settings API – sanitizing urls, email addresses and text
- What is the difference between esc_html and wp_filter_nohtml_kses?
- Nonces and Cache
- How to escape custom css?
- How do I create a user using the new JSON api in 4.7?
- AJAX nonce with check_ajax_referer()
- Verify nonce in REST API?
- Is wp_nonce_field vulnerable if you know the action name?
- Escaping quotes from shortcode attributes
- Sanitation needed for WP_Query or get_posts calls?
- Escaping WP_Query tax_query when term has special character(s)
- Using nonce in menu item
- Is it safe to assume that a nonce may be validated more than once?
- How to allow HTML tags into WP Bakery (formerly Visual Composer) `textfield` parameter
- Multiple ajax nonce requests
- Can I create customizer setting that can handle plugin shortcode?
- What is nonce and how to use it with Ajax in WordPress? [duplicate]
- How to sanitize select box values in post meta?
- Do I require the use of nonce?
- Does WordPress sanitize arguments to WP_Query?
- Getting “The link you followed has expired” when adding custom post [closed]
- WP doesn’t show Array Custom Fields?
- Make shortcode work with nested double quotes
- Do Cookies Need to be Sanatized Before Being Saved?
- Nonce in settings API with tabbed navigation
- Using Nonces for AJAX that only retrieves data
- Shortcode putting html such as
- WordPress REST API call generates nonce twice on every call
- WordPress “Link has expired” error on updating posts
- How to properly sanitize strings without $wpdb->prepare?
- How to verify nonce from Bulk/Quick Edit in save_post?
- Default WordPress settings API data sanitization
- How do I sanitize a javascript text?
- Fatal error: Call to undefined function wp_create_nonce()
- How to add/retrieve the post trash link?
- What is the difference between strip_tags and wp_filter_nohtml_kses?
- Handling nonces for actions from guests to logged-in users
- Using nonce external of WP Admin
- How to add WordPress nonces to ajax request
- Importing JSON feed should the content be sanitized?
- how to sanitize checkbox input?
- Nonce best practices: hidden input vs. wp_localize_script?