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?
- framework for plugin/theme options panel? [closed]
- How to get the path to the current theme?
- Single functions.php or split into many small files?
- Can someone explain what wp_session_tokens are, and what are they used for?
- What is an alternative method to the WordPress private _doing_it_wrong() function
- Check for featured image in WP_Query
- How to sanitize select box values in post meta?
- Update exisiting site to 3.5 release candidate
- Get file headers in custom file
- add_filter and remove_filter added before and after wp_query
- Having Problem On Getting WP Post Gallery Images URL
- How to: get main plugin/theme file?
- add_theme_support using a plugin
- How to bundle a plugin with a theme, or vice versa
- How Can I setup WP CLI on Windows development machine running AMPPS?
- WP_LOCALIZE_SCRIPT doesn’t work
- What is the difference between these two methods of writing $ instead of jQuery in WordPress [closed]
- Modify a Free Plugin available on wordpress.org & include with my Premium Theme? [closed]
- Best choice of options/settings framework for plugin/theme development
- Is there any way to have Featured Text, as opposed to Featured Image?
- Find source of notice / warning / errors efficiently
- StackExchange clone using WordPress?
- Sharing common functionality (functions, template parts) between plugins and themes?
- Display content from custom post without modifying the single template
- Can I change header.php of current theme through a plugin function?
- Tried in different ways but sidebar not working?
- 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?
- How to hook a custom user function to a wordpress core ajax action?
- Elementor custom Query with ACF fields to show matching woocommerce products custom fields
- WP Gutenberg Blocks – How to limit first/root blocks
- How developed with version control word press site on shared host? [closed]
- Following WordPress Markup Is mandatory, got awkward resultyby wordpress standard markup?
- How do I create plugin or theme using MVC pattern?
- PowerPress mobile media player
- When is the proper time to minify css and js with git workflow?
- How to Get Current Custom Post Type Associated Taxonomy Term
- Plugin templates vs Parent Theme
- Widget HTML Display Problem
- Is disabling test_form in wp_handle_upload a security concern?
- How to connect my wordpress plugin to a remote database securely?
- How to create a backend for a custom theme?
- WP Plugin Running before jQuery
- How do I have now a duplicated user entry if this is not allowed (and I cannot replicate it)?
- add_submenu_page hooked function must explicitly check user capabilities – why?
- my own SVN for a plugin/theme
- Why enqueue styles on hook?
- Getting a WordPress Debug Strategy
- Proper way to use useSelect
- Conditional Generation of Image Sizes using add_image_size
- WP Still Generating 150×150 Thumbnail Size Even After Un-Setting Small Size in Functions.php
- Is it possible to use WP-CLI in a plugin (or theme)?
- Secruity Questions on a timer
- modify show UI of a registered taxonomy
- Using function from enqueued .js file in theme in plugin?
- Does WordPress default CSS have Grids?
- How to resize WordPress images on upload to specific height and width without cropping it
- WordPress Page Reload Takes forever during theme development
- Anyone using unzip_file successfully? It uploads the zip but doesn’t extract it!
- Pass custom props to
- Include external po file for 3th party plugin to theme
- How do I add filter with woocommerce categories?
- Can’t upload image via submitting custom post from frontend
- Need Help to make a logic for editing posts in Frontend
- redirect_to how to make it simply work with get parameter or similar?
- Determine if the current page, is being edited
- Can i prevent the effect of the_title filter on the dashboard’s posts/pages titles?
- How to embed or integrated a custom WordPress Widget into the theme?
- Looping single post in a theme
- WordPress permalink setting
- Custom theme and plugin updating
- Is there a general way to get a themes primary colour?
- problem with blank page
- How to Register/Link to .js Files in WordPress Dynamicaly in Header.php
- grouping my widgets wordpress
- If I want to create new taxonomies (e.g. Project / Documents / Etc…) is it better to create them in the theme’s functions.php or within a plugin? [duplicate]
- How to add something after a function
- Best Way to Inventory the Media Library of a 200+ Multisite Installation?
- how to insert content into wp_head after loop_end
- how many rupee or dollar charge to client to make theme [closed]
- oneOf two possible objects in WP REST API?
- how to catch a data from a array in WordPress
- 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
- User set default settings for a Block in Site Editor