/ HTML Checker Fixes / Deprecated HTML

How to Fix Deprecated HTML Elements

Deprecated HTML elements — <center>, <font>, <marquee>, <frame>, <big>, <strike>, <tt> — still render in most browsers but have no guarantee. They appear most often in migrated content from old CMS installs and in templates that haven't been updated since 2010. This guide maps each deprecated element to its modern replacement and walks through bulk-fixing legacy content. For related fixes, see the HTML Checker Fixes index.

1. Get the full list

Step 1
Run the HTML Checker
Run the HTML Checker filtered to deprecated-element warnings. Export the CSV. Each row identifies the URL, line, and which deprecated element appears.
Step 2
Determine source: template or content
View source on a few flagged pages. Is the deprecated tag in template markup (header, footer, sidebar — fix once in the template) or in CMS-stored content (need bulk replacement in database)? Most are in content from old WYSIWYG editors.

2. The replacement table

DeprecatedModern replacement
<center>Content</center><div style="text-align:center">Content</div> or a CSS class
<font color="red" size="4"><span style="color:red;font-size:1.2em"> or a CSS class
<b> (when stylistic only)<strong> (semantic emphasis) or CSS font-weight
<i> (when stylistic only)<em> (semantic emphasis) or CSS font-style
<u><span style="text-decoration:underline"> (avoid — underline implies link)
<strike><del> (semantic deleted text) or <s> (no longer accurate)
<big>CSS font-size
<tt><code>, <samp>, or <kbd> depending on intent
<marquee>CSS animation or — better — remove (anti-pattern)
<blink>Remove. Was never serious.
<frame>, <frameset><iframe> for embeds, CSS Grid/Flexbox for layout
<applet><object> (Java not supported anyway)
<acronym><abbr>
HTML attributes like bgcolor, alignCSS background-color, text-align

3. Fix templates first

Step 1
Search templates for deprecated patterns
SSH into the site or use SFTP:
grep -rE "<(center|font|marquee|big|strike|tt|frame|blink)" /var/www/yoursite/wp-content/themes/your-theme/
Each match is a template file that needs updating. Apply the replacement table above.

4. Bulk-replace in CMS content

WordPress: Better Search Replace

Step 1
Run targeted database replacements
WP Admin → Tools → Better Search Replace. Take a database backup first. Then for each deprecated pattern:
Search:  <center>
Replace: <div style="text-align:center">
Tables: wp_posts, wp_postmeta
Dry run: yes (first), then real run
Repeat for the closing tag and each deprecated element. The plugin handles serialised data correctly.

Shopify: Liquid filter approach

Step 1
Apply replace filters in templates
In theme.liquid or specific section templates, filter rich-text output:
{{ product.description 
   | replace: '<center>', '<div style="text-align:center">'
   | replace: '</center>', '</div>'
   | replace: '<font color="red">', '<span style="color:red">'
}}
Quick fix; the real cleanup is editing each product's description in the admin panel.

Raw SQL (any platform)

Step 1
Direct database replace
BACKUP FIRST. Then:
UPDATE wp_posts SET post_content = REPLACE(post_content, '<center>', '<div style="text-align:center">');
UPDATE wp_posts SET post_content = REPLACE(post_content, '</center>', '</div>');
⚠️ Raw SQL REPLACE can corrupt serialised PHP data (Yoast, Elementor metadata). Use Better Search Replace plugin for WordPress instead of raw SQL.

5. Prevent recurrence

Step 1
Configure WYSIWYG editor to strip deprecated tags
TinyMCE in WP: filter via tiny_mce_before_init with valid_elements excluding deprecated tags. Custom editors: configure allowed-element schema to omit deprecated tags.
Step 2
CI linting
Add a build-time check that fails the deploy if templates contain deprecated tags:
! grep -rE "<(center|font|marquee|big|strike|tt|frame|blink)" ./src/templates/

6. Re-validate

Re-run the HTML Checker. Deprecated-element warnings should clear or drop to a handful of legacy content pieces you'll fix manually.

📐 Re-run the HTML Checker

Verify deprecated elements are replaced with modern equivalents.

Run HTML Checker →
Related Guides: HTML Checker Fixes  ·  Fix Unclosed Tags  ·  Fix Duplicate IDs  ·  HTML Checker Guide
💬 Got a problem?