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
- Check nonce in the new bulk_edit_posts action
- wp_verify_nonce vs check_admin_referer
- Do I need a nonce field for every meta box I add to my custom post type admin?
- Can I use the same nonce for multiple requests on the same page?
- Multiple ajax nonce requests
- Nonce in settings API with tabbed navigation
- WordPress “Link has expired” error on updating posts
- Can I verify nonce which was generated on a different WP site?
- Headless WordPress: How to authenticate front end requests?
- Nonces and Ajax request to REST API and verification
- How to stop _wpnonce and _wp_http_referer from appearing in URL
- Can’t seem to get wp_localize_script to work
- WP_LOCALIZE_SCRIPT doesn’t work
- wp_verify_nonce doesn’t return true on server when it matches the nonce
- Verify Nonce returns false – Request Nonce returns correct value
- wp-admin AJAX with Fetch API is done without user
- Using wp_localize_script to store the template url into a variable to use in JS
- How to Globally Use wp_localize_script() Ajax URL
- Get Current User info using wp_localize_script, in functions.php
- permission_callback has no effect
- Populate a Map at The Same Time as showing Posts via AJAX
- wp_localize_script not working on ajax response
- WP REST API – Nonce passes wp_verify_nonce even after logout
- Use of check_admin_referer with theme options and options.php
- Find out if enqueued script uses wp_localize_script?
- “The link you followed has expired” & “Error while saving” messages when adding new post
- SSO autologin WordPress + Ajax
- How to pass conditional array to wp_localize_script
- Is nonce in PHP form and Ajax both necessary?
- Integrating PHP into Javascript to display map markers with Google API – problem with wp_localize
- How to call wp_localize_script() after the script?
- How to enqueue the script without hardcoded in the theme files?
- How to register javascript variables in wp_localize_script?
- Nonce fails on ajax save
- Add action hook into wp_localize_script
- how to localized scripts of new page requested by ajax?
- Is it safe to use a global wp nonce per user instead of a nonce per action?
- Backbone with custom rest endpoints
- Using nonce when loading posts with AJAX
- wp_localize_script not passing the data
- Using template tags in external JS file
- Saving custom data via ajax with nonces
- Getting jQuery AJAX to work in WordPress (getting -1)
- Log in user using WordPress REST API
- WP_List_Table Inside Metabox With Bulk Actions Not Working on Submit
- How do I mitigate replay attacks when talking about actions that shouldn’t happen twice?
- localize_script or rest api
- Issue with wp_localize_script
- Translate string with wp_localize_script()
- How can I verify WordPress nonce from the following code?
- bundled jquery in theme js not working with wp_localize_script
- AJAX form not working, still reloads on submit
- wp localize script makes variable global, how to solve that?
- Multiple shortcodes only use attributes from one of the shortcodes on custom plugin
- Pass list of categories to JS
- Create nonce in frontend page to edit profile
- when saveing $meta_box i get Undefined index error
- Is Nonce Verification (CSRF) required for WordPress Custom Bulk User Actions?
- Nonce validation in REST API