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?
- framework for plugin/theme options panel? [closed]
- How to get the path to the current theme?
- ajaxurl not defined on front end
- What process do you use for WordPress development? [closed]
- Why does WordPress use outdated jQuery v1.12.4?
- What is the advantage of using wp_mail?
- How to store username and password to API in wordpress option DB?
- Should Plugin Folders Include a Blank index.php File?
- How to include jQuery and JavaScript files correctly?
- Single functions.php or split into many small files?
- How can I configure Docker for developing and deploying a custom theme?
- Where to store PHP files created by plugin / themes
- Nonces can be reused multiple times? Bug / Security issue?
- How to post data to same page in wordpress
- 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
- WordPress and PHP Sessions – Security and Performance
- Understanding WordPress functions’ naming conventions
- Should I create a theme or a plugin?
- Include third party Javascript library which is not included in WordPress
- Is there widely accepted phpDoc syntax for documenting which hook calls a function?
- Where do I start from
- WP 3.3 Tooltips API?
- jQuery in header or footer
- 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?
- Nonce in settings API with tabbed navigation
- Log in from one wordpress website to another wordpress website
- Update exisiting site to 3.5 release candidate
- How do I Make a Theme “plugin-ready”?
- Authoritative answer on which boots first – Plugins or Themes?
- How to Add Font Awesome Icons to WordPress Menus?
- How to Add a .js file Only in one specific Page Dynamically to Head
- Show a user their recently viewed posts
- How to Use WordPress Color Picker API in Custom Post Type Metabox
- Get file headers in custom file
- add_filter and remove_filter added before and after wp_query
- WP Cron doesn’t save or in post body
- Custom theme sufficient or custom plugin neccessary for this feature set?
- Having Problem On Getting WP Post Gallery Images URL
- What’s the difference between hooks, filters and actions? [duplicate]
- How to use filter hook ‘post_updated_messages’ in coherence with action hook ‘save_post’
- How to create custom home page via plugin?
- Add new user and add meta at once
- How to: get main plugin/theme file?
- How to debug WordPress correctly?
- Custom user profile, registration, login page with theme
- add_theme_support using a plugin
- Featured Image not showing in admin
- Should I use RIPS tool to test my themes and plugins?
- How to Display Custom Post Type’s Gallery (images ) in Through WP_Query
- Customizer Not Saving Options
- How to bundle a plugin with a theme, or vice versa
- What is better way to use Bootstrap inside admin panel?
- How to add Font Awesome 5 icons in WP Admin dashboard menu?
- WordPress restrict plugin file direct access
- append code after the_content not working
- How can I make my website with wordpress having on-spot editing feature as compared to concrete5 CMS?
- Problem with Poedit [closed]
- Best Way to Inventory the Media Library of a 200+ Multisite Installation?
- Loading jQuery library from WordPress admin
- Using tag or inline style attribute?
- how to insert content into wp_head after loop_end
- Is Explicit Versioning a better alternative to Semantic Versioning for wordpress?
- Invalid Menu Items
- how many rupee or dollar charge to client to make theme [closed]
- Gutenberg text field validation
- oneOf two possible objects in WP REST API?
- How to get the value entered in the input field in wordpres
- Sanitize and Save metabox values
- how to catch a data from a array in WordPress
- How are themes and plugins localized using the gettext GNU framework?
- How react js and other Javascript Technologies works on WordPress plugin?
- Theme, Plugin or Both?
- Is there any other ways to replicating changes on live from staging without pushing from git
- How to create A – Z List with pictures?
- Hook a search form anywhere on the site, using a custom plugin
- Why isn’t custom sidebar panel not showing up in the Gutenberg Editor?
- 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
- Sanitization of register_setting()
- How to customize password reset message page on success if no error in password reset
- All Pages and Post are redirecting to 404 Not Found in wordpress
- useBlockProps() nests wrapper with class name inside block wrapper in the editor
- User set default settings for a Block in Site Editor
- WordPress Block with Interactivity API e Preact Component