Contrary to what you have been looking at, esc_html
does not strip all the HTML, it escapes it, meaning it encodes it into safe HTML entities that do not break HTML tags.
wp_filter_nohtml_kses
strips all the HTML.
When in doubt always consult the source code. It is accessible online.
esc_attr
is short and sweet, uses _wp_specialchars
, defined in wp-includes/formatting.php
wp_filter_nohtml_kses
is defined in wp-includes/kses.php, and “Strips all of the HTML in the content.“
Related Posts:
- What is the difference between strip_tags and wp_filter_nohtml_kses?
- In Which Contexts are Plugins Responsible for Data Validation/Sanitization?
- How to properly validate data from $_GET or $_REQUEST using WordPress functions?
- Escaping built-in WP function return strings
- Coding a plugin on WordPress; when should I sanitize? [duplicate]
- WordPress security issue to output data from user input from theme option form
- wp_nonce_field displaying twice
- Is it necessary to do validation again when retrieving data from database?
- Why would you use esc_attr() on internal functions?
- Using HTML links within translatable string
- Using password protection to load different page elements?
- esc_url, esc_url_raw or sanitize_url?
- Autoloading & Namespaces in WordPress Plugins & Themes: Can it Work?
- How to get the path to the current theme?
- Why does WordPress use outdated jQuery v1.12.4?
- What is an alternative method to the WordPress private _doing_it_wrong() function
- Should I create a theme or a plugin?
- Where do I start from
- WP 3.3 Tooltips API?
- Check for featured image in WP_Query
- How to sanitize select box values in post meta?
- wp_remote_get doesn’t work with secure connections https?
- How to Use WordPress Color Picker API in Custom Post Type Metabox
- Get file headers in custom file
- Custom theme sufficient or custom plugin neccessary for this feature set?
- How to: get main plugin/theme file?
- add_theme_support using a plugin
- What is the difference between these two methods of writing $ instead of jQuery in WordPress [closed]
- Plugin development: is adding empty index.php files necessary?
- Paging on a future post loop?
- Is there any way to have Featured Text, as opposed to Featured Image?
- Find source of notice / warning / errors efficiently
- Why do I need to check if wp_nonce_field() exists before using it
- Problem with is_active_sidebar?
- StackExchange clone using WordPress?
- Sharing common functionality (functions, template parts) between plugins and themes?
- How to sanitize user input?
- Change template dynamically
- Get Current Menu Location inside Nav_Walker
- Verify if user is wordpress logged in from another app since wordpress 4.0
- Short code not working in boostrap modal dont no why?
- Is there a way to list all actions registered by a plugin or theme?
- Howto: Use Custom Post Types as Submenu Items in Admin
- Extending theme PHP class in plugin
- Elementor custom Query with ACF fields to show matching woocommerce products custom fields
- what is the difference between these phares?
- How developed with version control word press site on shared host? [closed]
- How to limit number of number of categories displayed by categories widget
- PowerPress mobile media player
- When is the proper time to minify css and js with git workflow?
- Warning: include(): https:// wrapper is disabled in the server configuration by allow_url_include=0
- Plugin is not generating title tags on any pages or posts
- Make a plugin page out of influence of the theme’s style
- Update Data parameter of a wp_localize_script() call
- get_the_tags with separator control?
- Checking a WordPress for OWASP top 10 vulnerabilities [closed]
- 400 Bad Request, in wordpress theme development, wp_ajax
- Add child pages to submenu automatically
- Are there any security risks when submitting data-attribute data through AJAX?
- Why in this archive page that call query_posts() function show only the last 10 posts?
- How to find where an object first instantiatiation
- Full documentation about $args for register_rest_route?
- How to replace settings in WordPress plugin from a theme
- Save temporary registration data
- How to remove/replace current page template?
- WordPress dynamic widget by location?
- How can the_excerpt (or equivalent) be called on a category description?
- Change the behaviour of a button
- WP_Query order posts by category
- Configuring Xdebug with docker compose
- How to access index file in Block Themes?
- WordPress Favicon not Working For Images/Videos/PDFs
- HTML Elements in my WP Plugin being generated in JS. Security and Translated Text Question about this method being used
- Want to know how to reveal a WordPress theme, considering the theme name is hidden?
- How to store sensitive user data (passwords)
- Redirection from a specific page for users logged in but not with membership
- How can we stop showing short code in create or edit post section
- Sanitize WordPress Array Input?
- Is it possible to develop themes and plugins locally while still allowing content to be updated directly in the admin dashboard?
- how to add security questions on wp-registration page and validate it
- Replace “content-area” of themes 404 page with plugin?
- Autoloading & Namespaces in WordPress Plugins & Themes: Can it Work?
- set a custom post type to a taxonomy term programmatically in metabox
- Custom premium registration form and profile page for a WordPress Web Application
- How to destroy or dispose wordpress uploder/manager?
- Array/List Edit in Backend
- Font Awesome stopped showing icons, shows &# text instead [closed]
- To remove rendering of menus and header, plugin or theme?
- Managing Custom Designed Content
- How can I add recent posts to menu like mashable
- Generate activation url
- Display Data’s metabox in page
- Ajax functions – no access to wp-admin.php only online
- Saving multiple fields as array
- How can I make my website with wordpress having on-spot editing feature as compared to concrete5 CMS?
- Gutenberg text field validation
- How react js and other Javascript Technologies works on WordPress plugin?
- Is there any other ways to replicating changes on live from staging without pushing from git
- Fetch Custom Woocomerce filed data and check the data avialble in Wp-user table as nicname or username using function.php
- Remove Gutenberg Buttons Block