Support » Plugin: WP Realtime Sitemap » Strip HTML from category description

  • If you have enabled (and used) HTML in the category descriptions on your site, it messes up the WP Realtime Sitemap formatting. The sitemap uses the category description as the link “title” attribute and the title attribute can’t deal with any HTML (in our case, a href links) – it ends up displaying part of the category description on the page.

    The simple solution is to strip out html tags for the category description by modifing “wp-realtime-sitemap/wp-realtime-sitemap.php” changing:

    $posts .= '<li><a href="' . get_category_link($category->term_id) . '" title="' . $category->category_description . '">' . $category->name . '</a><ul>';

    To
    $posts .= '<li><a href="' . get_category_link($category->term_id) . '" title="' . strip_tags($category->category_description) . '">' . $category->name . '</a><ul>';

    Submitting this code change as a request for any future releases!

    https://wordpress.org/plugins/wp-realtime-sitemap/

  • The topic ‘Strip HTML from category description’ is closed to new replies.