Maybe you could try this, to sanitize the whole $_POST
array
$_POST = filter_input_array(INPUT_POST, FILTER_SANITIZE_STRING);
Or to sanitize just a field, you could use the native WP function
$sanitized = sanitize_text_field ( $_POST['key'] );
Related Posts:
- Show only one post for each author ( Page loads too slow )
- Modern Tribe Calendar wp-query with meta query not working at all
- if statement on database query
- Looking for most performant way to execute several similar WP queries within shortcodes
- Why is variable not working on custom sql query using wpdb?
- Create WP_Query to search for posts by their categories or their parent/child categories
- WP_Query adds “(wp_posts.ID = ‘0’)” so no results are returned
- get_posts() and WP_query limits ‘AND’ conditions to a maximum of 6 for meta value queries in WordPress
- inserting a post from an extern php file but post content doesn’t show on wp site
- Hide posts if user is added to it WP_query
- Custom route and query
- WordPress WP_Query without query GET parameters
- How to WP_Query posts order by parent title?
- Passing in MySQL prepare statement parameter separately throwing error
- Usermeta data unserialize, extract and display in table in WordPress
- how to get data from two different table from wordpress database
- Query doesn’t display text data with apostrophes
- SQL Query Search page
- How can I display a query in a page?
- Custom query_posts() parameter
- Execute multiple PHP Snippets causes error?
- How do I use WP_query with multiple post IDs?
- dbDelta support for FOREIGN KEY
- Include WP_Query in my own PHP file?
- Inject post (from specific category) between posts in Loop
- How to correctly submit a search form and display the result in an independent page
- is_page() not working from within a plugin
- Does WordPress cache get_user_meta() results?
- Passing JSON data from WP Query into AJAX causing NULL errors
- Using Echo in ShortCode – Stuck
- MySQL query performed 4 times inside loop
- How to add 2 posts under another post? Formatting should be intact
- No wp-config.php file on local install of wordpress – site still displays
- Use ajax to update_post_meta
- Count number of published posts by type
- How to display custom field on homepage
- Can an array be used as a meta_query value?
- Can’t increase posts_per_page by variable
- Insert all post IDs in new database table
- WordPress WP_Query() Not working properly
- What SQL / WordPress queries would need a nonce?
- Different database query in function.php using mysqli
- Get taxonomy terms only of the WP_Query current posts
- How to do multiple searches (with logical OR) in WP_Query in hook pre_get_posts?
- Get WooCommerce product details and transfer them to a custom DB table
- get current custom post ID by WP_Query method
- What is a valid parent for get_terms()?
- Calculating a large number of MYSQL queries as customshort codes, slow
- Dynamic content based on a URL parameter
- Sum the total amount of a specific product purchased per user and display in table
- Security for data obtained from the database
- How to retrieve the data from the sever and displaying it in a page?
- How to overwrite orderby with add_query_var
- Make a database query using WordPress
- get_the_ID() in the footer returns wrong value
- WP_Query multiple post results
- echo var into wp_query
- Using wordpress function to retrieve data
- form $_post action value gets truncated after it passes through two forms
- Add row to custom database Table and delete all rows older than 1 day
- Toolbar Hidden in a Virtual Page
- making php value numeric
- Removal of all posts content in bulk, keeping the posts itself
- Wp Query : Order by distance lat,lon
- get different meta-data of a complicated query at the same time
- Please help! I have a problem with getting wordpress databas
- How to run complex query using PHP
- Using a new WP_Query inside the loop
- WordPress sorting posts by date and title using a dropdown
- How to get specific multiple pages excerpts at homepage?
- Conditional formatting on data fetched from MYSQL
- Can I split a huge wp_postmeta table across different databases or servers?
- WordPress mysql deos not work with php7
- Wp-query output correct, but the loop shows one less item (only sometimes)
- How to display sticky post always at the top (before regular post) in wordpress?
- Error inserting into custom table – Object of class wpdb could not be converted to string [closed]
- WP + MySql db / PHP
- The plugin generated 225 characters of unexpected output during activation
- append data to mysql table via submit button coded in php – not working
- WordPress select query issue
- How to do a MySql query in WordPress?
- Add two or multiple functions in WordPress Post or Page
- direct query to post_meta table
- Send data from plugin to external database
- How to set max users to 17.000
- directorypress theme error mysql_error() [closed]
- List sibling pages widget, exclude current page
- Cannot Upload Custom Header Image into WordPress Dashboard
- Does wp_query and query_posts affect website performance? [duplicate]
- WordPress post pagination on custom template not working
- Ajax Load More or View More functionality for woocommerce category layout by template overriding
- Predefine Magazine Style Layouts
- Parse error: syntax error, unexpected ‘}’ in C:\xampp\htdocs\admin\products.php on line 148 [closed]
- How to set variable to specific field when querying
- Variable ++ in query loop
- XML WP_Query problem in PHP 8.0 and 8.1
- a problem in class in class-wp-hook.php
- Error resetting database index using ALTER TABLE in $wpdb->query
- Count custom posts type and filter by tag
- AJAX WP_Query’s order and orderby parameters not working