Fixing the “attribute ‘clear’ not allowed here” EPUB Error
The error: attribute “clear” not allowed here; expected attribute “class”, “id”, “style” or “title”
Why This Happens
The clear attribute (usually appearing as clear=”all”, clear=”left”, or clear=”right” ) is a legacy HTML attribute Word often inserts on <br> tags to control how text wraps around images or floated elements. It’s a holdover from old-style HTML and isn’t valid in the stricter XHTML format EPUB requires, which triggers this validation error during conversion.
How to Fix It
- Open your document in Microsoft Word.
- Go to Save As, and choose **Web Page, Filtered (.htm; .html) as the file type.
- Close the document in Word.
- Open the saved HTML file in a plain text editor (Notepad on Windows, TextEdit in plain-text mode on Mac).
- Use Find and Replace to search for clear=”all” (the most common variant).
- Replace it with a single space, using Replace All so every instance in the file is caught, not just the first.
- Repeat the search for clear=”left” and clear=”right” — Word can insert any of these variants, and each one triggers the same error individually.
- Save the file and re-run it through your EPUB conversion or validation tool to confirm the error is gone.
Skip the Manual Fixes
If you’d rather not hunt through raw HTML for legacy attributes, we format manuscripts to be clean and validation-error-free from the start.
See our other resources covering ePub errors.
