force_balance_tags()
is not a really safe function. It doesn’t use an HTML parser but a bunch of potentially expensive regular expressions. You should use it only if you control the length of the excerpt too. Otherwise you could run into memory issues or some obscure bugs.
The other problem is: the function uses two hard-coded lists of elements for single tags and nestable tags. There are multiple places where WordPress uses such lists, and they are not kept in sync. So when you use an element that isn’t part of these lists or changed its nesting behavior you may end up with incorrect markup.
Related Posts:
- Where is definied the theme location for the main menu in a WordPress template?
- Theming Using Bootstrap Glyphicons and WordPress Dashicons
- Random white space before doctype
- Why I obtain different visualization when I run the website on my local machine and on remote server?
- Some doubts about WordPress handle the horizontal main menu visualization
- Why the slideshow is not shown in my theme?
- Theme customizer live preview JS- Trying to bind to an html image url without luck
- Standard Way To Do Custom Work Within A Page?
- Dynamic nav menu with icons [closed]
- Add a dropdown to theme customizer
- Hide a div that is part of all pages on one specific page
- Why I can’t add a CSS style in this WordPress theme?
- Is it good to rename theme folder downloaded from WordPress.org?
- Editing the custom background CSS
- What, specifically, should be included in theme_name_setup()?
- How to get gallery images?
- Is the theme customizer slowing down my site?
- How can I get wp_head() as a string instead of echoing it?
- What does “Do not deregister the jquery script in the administration area” mean?
- What is the best book to learn how to make themes for wordpress?
- Symlink a directory to wp-content/themes
- Single Page WordPress Theme – Using page templates
- How do I make my wordpress page more friendly for mobile viewers?
- What are WooCommerce starter themes? [closed]
- How to disable the gradient and font size internal CSS added by WordPress when using theme.json
- Is there an error in get_the_tag_list()?
- Example of a theme organization without all the default wp files in root
- Disable the Custom Internal CSS added by theme.json for Certain Pages
- Unwanted blank lines before tag
- How do I display the “Archives” widget layout (sidebar) in WordPress by ‘year’ then by ‘months’?
- Which theme foundry has clean coded themes, where code is poetry [closed]
- How do you protect a premium theme from being copied?
- How can a Theme Contain no Header File or Footer File?
- Custom Nav Walker Displaying Values in Sub Menu
- How to configure wordpress to work with Vuejs with SSR and without hashbang
- How can one update a theme on a live site without interruption?
- Sub folder CSS that’s read by Admin panel
- Some translations do not work in my template class
- Some doubts about how to show posts in a custom theme?
- Dequeue a style file which is making website load slow!
- WordPress not registering Theme Customization Section
- Can’t delete theme
- How to add a second stylesheet to the editor
- Single Page theme [closed]
- Can I have two different theme for two different language?
- WP_Comment_Query – Get comments and answers separately
- excerpt() shows different result between remote and localhost(development environment)
- Prefix best practice, should we use framework name or theme name?
- Theme Javascript.php Overwritten Nightly [closed]
- How to add Space between sidebar and footer widget in WordPress theme [closed]
- How can my theme allow users to take advantage of advanced html tags in posts
- Call to undefined function add_menu_page() on theme activation
- What’s stopping my HTML from rendering in my template parts?
- how to get the post attachement image in full size?
- Is it acceptable for a WordPress theme to not accept widgets?
- Should all references to a text domain be to my current theme?
- Set a featured image as a replacement to the header image
- Theme Customizer not displaying saved values in wp_head (CSS)
- Simple child theme modification but links are broken
- Making a WordPress theme based on twentyten
- Thesis -style Navigation
- theme style is applied on the dhasboard rather than the website
- Alignment Problem [closed]
- What $handle does WordPress use for a theme’s implicit style.css?
- Converting a static HTML template into a WP theme – How do I specify page content?
- multiple html/css files for wordpress theme?
- Unwanted empty line at the beginning of document
- Why is my container argument not working for wp_nav_menu() [closed]
- best practices for updating wordpress theme
- Theme Checker Text Domain
- help needed for suit designing tool
- How to modify theme content in Thematic?
- How to copy page/post from one theme to another?
- Not sure how to debug this npm install error. This is a wordpress theme that comes with a built-in gulp/webpack task automation [closed]
- How to update mark-up of a gallery block in a custom theme?
- Host Private Custom Theme
- My wordpress theme name isn’t updating straight away
- Customizer API Multi Sections in single Panel
- WordPress theme options checkbox default checked state
- Copying a modified theme from one wordpress site to another wordpress site [closed]
- How can I change this SVG shape that’s generated?
- Adding a second logo next to the main one in header
- (Parent) theme Is Not Showing In Theme Selection Panel and Therefore Breaks Child Theme
- Are paginated comments required for publishing Themes?
- How to show some of category in wordpress
- using themename_the_custom_logo() in template-tags?
- Creating a theme just to deploy a single page
- Custom page template not showing on page creation
- Correct was to customise theme using get_theme_mod in scripts
- Weird ‘theme update’ error [duplicate]
- Redirect to custom login page
- WordPress two sidebar layout or theme
- Display Today’s date outside the loop?
- Add Dynamic Sidebar to Exisiting WordPress Theme [closed]
- How can I install my custom-made theme on a wordpress.com blog? [closed]
- HTML to WORDPRESS [closed]
- .submenu class missing in output from wp_nav_menu
- How to make a multilingual wordpress site to be translated one-to-one without much effort and without using translate?
- Is there a way to have WordPress autodetect page templates in the page-templates directory and any sub-folders?
- My wordpress site memory exhausted more than 1GB trying to debug with default