Depends, will the form work with AJAX turned off?
If so use an input and degrade gracefully.
Otherwise, define nonces used by JS using JS for consistency, and to prevent grabbing stuff from the DOM
Related Posts:
- How does nonce verification work?
- How to expire a nonce?
- Fatal error: Call to undefined function wp_create_nonce()
- How to add/retrieve the post trash link?
- Using nonce external of WP Admin
- “The link you followed has expired” when previewing a post
- wp_verify_nonce keeps failing
- Handling nonce generation in AJAX registration process
- increase nonce lifespan
- wp_verify_nonce() via REST always returns false
- Nonce failing in IE
- Nonces, AJAX, script variables & security in WordPress
- my theme breaks WP export
- Why am I getting a 403 from check_admin_referer()?
- how to send Ajax request in wordpress backend
- x-wp-nonce across domains
- wp_create_nonce doesn’t verify when using WP_List_Table
- Handling expired nonces
- What is really “wp_nonce_field” and how does it work? [duplicate]
- Cannot verify nonce
- wp_verify_nonce return false despite correct parameter passed
- WordPress JSON API nonces and Vue development server
- Verify a nonce in Form submission
- phpcs error in WordPress
- Stop WordPress nonces expiring
- Several nonces?
- Nonce for Trashing Item
- Nonce keeps failing
- Public posts – preventing duplicate form submissions
- How to obtain “wp_rest” nonce for WP Statistics plugin manually?
- WordPress “nonce” message
- CSP nonces with Cloudflare Workers
- Why are nonces working in Firefox but not in Chrome?
- wp_verfy_nonce keeps giving false
- Nonce – reissue with ajax poll
- wp_nonce_url generating invalid links
- How to insert wp_nonce field within echoed string
- Nonce check causing issues when creating new post
- WordPress wp_localize_script nonce and ajax URL
- Weird nonce validation problem
- Logout button in menu without “wp” in links
- Is it possible to use wp_localize_script to create global JS variables without a specific script handle?
- Nonces can be reused multiple times? Bug / Security issue?
- Using nonce in menu item
- Do I need to escape data passed to wp_localize_script()?
- wp_localized_script is not defined when called via jquey ajax
- WordPress REST API call generates nonce twice on every call
- Use wp_localize_script for non existing script
- WordPress failure when logging out
- How to add extra attributes to the script tag added via wp_localize_script()
- Localize variable for multiple Shortcodes
- How to localize value of posts
- How do you pass a boolean value to wp_localize_script [duplicate]
- How to overwrite JS variable with wp_localize _script?
- wp_verify_nonce always returns false when logged in as admin
- Pass multiple PHP variables to JS in Options Page
- Can not pass the value of google pie chart from custom meta box
- Remove type attribute from script added by wp_localize_script
- Ajaxing in functions.php
- wp_nonce_url to users.php for deleting user not working
- How to check an ajax nonce in PHP
- wp_verify_nonce not working
- WP Admin AJAX Security – using POST to include a relative URL
- wp_create_nonce() in REST API makes user->ID zero
- WordPress Ajax problem with undefined url
- wp_create_nonce function doesn’t work inside a plugin?
- Nonce failing on form submission
- Found 2 elements with non-unique id (#_ajax_nonce) and (#_wpnonce)
- Why ajax doesn’t work on certain wordpress hooks?
- Custom login doesn’t work properly
- Is there value in using a wp_nonce for POST requests?
- Localizing script to pass a value to a javascript function
- How to add ajax url to js using wp_add_inline_script()?
- in jquery read a multidimensional array via wp_localize_script()
- How can I get variable from php function and use it in wp_localize_script?
- issue in wp_localize_script
- How to use nonce
- Re-use Nonce in Repeating Event Signup Buttons
- wp_localize_script() and JavaScript namespaces
- How to add a WordPress Nonce for this form to avoid CSRF
- Getting a variable inside foreach from PHP to JS after localization
- Parsing post->ID in included plugin file
- wp_enqueue_script calling jQuery at different times for different browsers?
- Get localize of a loaded javascript
- localize_script but data changes dependent on product ID
- Using a nonce Content Security Policy header for style-src for inline style elements returns errors
- Get with jQuery the value of an ACF field
- wp_verify_nonce not working on the mobile device
- How to not cache nonces with WP Rocket?
- whether a nonce is required for get type and get_query_var?
- Unable to update plugins or log out
- Does it make sense to check a nonce on user log in?
- CSRF attack to create USER
- Using wp_localize_script in template file – is it secure?
- Is it necessary to use a WordPress nonce when allowing users to download public data?
- wp_localize_script not create variable in head section
- Passing widget options to external script
- Using WP Ajax and jQuery to process multiple forms on the same page?
- Import js variables loaded via wp_localize_script() into js module without global scope connection
- Saving metabox updates causing fatal error