The Movable Type Knowledge Base

No HTML in Excerpt

Question

When I use the MTEntryExcerpt tag, all the HTML is stripped from the text.

Answer

When Movable Type auto-generates the excerpt, it first removes HTML from the entry body text, and then counts to the number of words you've specified for the Excerpt Length setting under Default Weblog Display Settings (on the Settings > General screen)1. If the HTML were not removed first, then the excerpt could inadvertently include open HTML tags, depending on where the word count ends.

The solution to this is to enter your own excerpt text into the Entry Excerpt field (using whatever HTML you wish) on the Edit Entry screen. Then Movable Type will use that excerpt instead of auto-generating one for you (and therefore, not remove HTML from it).

1 In versions prior to 3.2, this setting is named Number of Words in Excerpt, and is located on the Weblog Configuration > Preferences screen.

Submit Feedback on This Article

Your comments on how we can improve this article are appreciated; but please do not use the feedback form to submit support requests or questions. We will not respond to or publish such queries submitted through this form. If you have a technical question or problem, visit Movable Type Support.

Yahoo! Small Business web hosting services

Six Apart
Makers of weblog software and services for individuals, organizations and businesses.
This website is powered by Movable Type.