# AgizoAI HTML AI Clean Up Documentation

## Overview

AgizoAI HTML AI Clean Up is a WordPress editor utility for scanning, scoring and cleaning messy HTML that has been copied from AI tools, chat assistants, document editors, page builders or other rich-text sources.

The plugin changes only the content currently open in the editor. It does not save, publish, track or send content anywhere.

Official plugin page: https://www.agizoai.com/agizoai-html-ai-clean-up-wordpress-plugin

## Version 1.6.3 workflow

The plugin uses one top-level WordPress admin menu: **AgizoAI HTML AI Clean Up**. Under this umbrella menu you will find **Overview**, **HTML Scan** and **Settings**. The main workflows are the read-only site-wide scanner, the editor clean-up box and the Settings page.


### Unified admin menu

After activation, the plugin adds one top-level admin menu named **AgizoAI HTML AI Clean Up**. This keeps all plugin options and tools together instead of splitting settings under WordPress Settings and scan tools under WordPress Tools.

- **Overview** gives quick access to the scanner and settings.
- **HTML Scan** runs the site-wide scanner and selected-post clean-up tools.
- **Settings** controls enabled post types, default presets, custom clean-up rules and protected elements.

### Site-wide scanner

Go to **AgizoAI HTML AI Clean Up > HTML Scan** to scan existing content without changing posts. The scanner checks recent editable posts, pages or public custom post types by status and shows:

- Number of scanned posts.
- Number of posts needing review.
- Risk distribution: Clean, Low, Medium and High.
- Post title, status and modified date.
- Risk score and recommended clean-up preset.
- HTML quality score and quality warning count.
- Detected hidden/noisy HTML items.
- A direct link to open the post editor for manual review.

The site-wide scanner is read-only. It does not save, publish, update metadata or clean content automatically.

### Editor clean-up box

The editor box includes six main actions:

1. **Scan Content** – checks the current editor content and reports AI/tool attributes or hidden HTML that can be removed. It does not change the article.
2. **Preview Clean Up** – prepares the cleaned HTML and shows the AI Paste Scan Report before changes are applied.
3. **Clean Selected Block** – cleans only the currently selected Gutenberg block.
4. **Apply Clean HTML** – cleans the full current editor content immediately.
5. **Check HTML Quality** – analyses the current editor content and reports a quality score, accessibility warnings and SEO-safe HTML checks without changing the article.
6. **Undo Last Clean Up** – restores the editor content from before the last clean-up, before the post is saved.

The preview report can also copy the cleaned HTML to the clipboard when the browser allows clipboard access.


## Editor Quality Tools

Version 1.6.3 includes local editor quality checks. The **Check HTML Quality** button analyses the current content in the browser and does not save or transmit anything.

The report includes:

- HTML quality score from 0 to 100.
- Quality level: Excellent, Good, Needs review or Poor.
- Accessibility warnings.
- SEO-safe HTML checks.
- HTML structure checks.
- Word count.

Accessibility warnings can include missing image alt text, empty image alt text, iframes without title attributes, links without visible text, weak link text such as “click here”, skipped heading levels, duplicate IDs and tables without header cells.

SEO-safe HTML checks can include H1 tags inside the post body, unsafe or empty links, long content without subheadings, long paragraphs, markdown artefacts and very short content.

HTML structure checks can include empty blocks, duplicate IDs, markdown artefacts and excessive `div` or `span` wrappers. These checks are editorial helpers and do not replace a full SEO or accessibility audit.

## AI Paste Scan Report

The report shows:

- Risk level: Clean, Low, Medium or High.
- Numeric risk score.
- Recommended preset.
- Auto Detect preset used, when Auto Detect is selected.
- Counts of detected hidden/noisy markup.
- Protected items kept intact.

Detected items can include HTML comments, SVG blocks, script/style fragments, hidden inputs, hidden elements, `data-*`, `aria-*`, `role`, `style`, empty attributes, event attributes, XML/namespace attributes and Microsoft Office formatting markup.

## Clean-up presets

The plugin includes these presets:

- **Auto Detect** – scans the content and chooses a suitable preset before cleaning.
- **AI Tool Paste** – targets attributes, comments, hidden fragments and wrappers commonly copied from AI chat or writing interfaces.
- **Google Docs Paste** – removes rich-text noise while protecting tables, images, links and article structure.
- **Microsoft Word Paste** – targets Office classes, XML-style attributes, inline styling and pasted formatting noise.
- **Page Builder Paste** – removes noisy wrappers more carefully while protecting embeds, figures and block structure.
- **Strict Article Clean** – for editorial article HTML. It removes more formatting and keeps common content tags.
- **Safe Clean** – removes lower-risk noise while preserving most visible formatting.
- **Standard Clean** – recommended for normal AI copy-paste clean-up.
- **Aggressive Clean** – removes the most markup noise and should be reviewed carefully.
- **Custom Clean** – uses the rule and protection checkboxes configured in the plugin settings.

## Protected elements

Protected elements are temporarily shielded during clean-up. This helps avoid unwanted changes to useful content.

Default protected elements:

- WordPress shortcodes.
- iframe, embed, video and audio blocks.
- Tables.
- Image tags and alt text.
- Figure and caption blocks.
- WordPress block editor comments.
- JSON-LD schema scripts.

## Settings page

Go to **AgizoAI HTML AI Clean Up > Settings** to configure:

- Enabled editor locations, including posts, pages and public custom post types.
- The default AI paste preset.
- Custom Clean rules.
- Protected elements.

## What Standard Clean removes

Standard Clean removes common AI copy-paste noise and hidden code fragments, including:

- AI, editor and tool metadata stored in `data-*` attributes.
- HTML comments hidden inside pasted content.
- Hidden inputs and elements marked as `hidden`.
- Invisible elements using `display:none` or `visibility:hidden`.
- Inline SVG blocks pasted into the article body.
- Pasted `script`, `style` and `noscript` blocks.
- Copied `aria-*` attributes.
- Copied `role` attributes.
- Inline `style` attributes.
- Empty attributes such as `class=""` or `id=""`.
- `class` attributes from `div` wrapper elements.
- JavaScript event attributes such as `onclick`.
- XML and namespace attributes.
- Microsoft Office-specific attributes and classes.

## How to use

1. Optional: go to **AgizoAI HTML AI Clean Up > HTML Scan** to find existing posts that may need review.
2. Open a post, page or enabled custom post type in the WordPress editor.
3. Find the **HTML AI Clean Up** box in the editor sidebar.
4. Choose an AI paste preset.
5. Use **Scan Content** or **Preview Clean Up** to review what will be removed.
6. Use **Check HTML Quality** to review accessibility, SEO-safe HTML and structure warnings.
7. Use **Clean Selected Block** when only one Gutenberg block needs cleaning.
8. Use **Apply Clean HTML** for full-post clean-up.
9. Review the cleaned content.
10. Save or update the post manually.

## Important review note

The plugin is designed for normal article content. Review the result before saving if the post intentionally contains custom embeds, inline SVG, scripts, hidden accessibility text or advanced HTML.

## External services

The plugin uses no external services. It does not connect to OpenAI, ChatGPT, AgizoAI servers or any third-party API.

## Privacy

The plugin does not collect, store or transmit personal data. It does not create cookies, tracking pixels, analytics events, remote logs or front-end scripts.

## Security and WordPress.org review notes

- Global PHP identifiers use the unique `AGIZOHACU` / `agizohacu` prefix.
- The plugin has no unprefixed global PHP functions.
- Settings are registered through the WordPress Settings API and sanitised before storage.
- Admin forms use WordPress nonces. AJAX actions use nonce checks and capability checks.
- PHP admin output is escaped. AJAX data is encoded as JSON and rendered in JavaScript with text-safe DOM methods.
- The plugin does not track users, send analytics, create cookies, perform remote logging or call external APIs.
- The plugin does not register push notifications, service workers or browser notification prompts.
- The plugin does not cache public, private or logged-in pages.
- The plugin does not inject popups, advertising overlays or front-end scripts.

## Developer filter

Administrators can enable public post types from the settings page. Developers can also extend this by using:

```php
add_filter( 'agizohacu_supported_post_types', function( $post_types ) {
    $post_types[] = 'page';
    return $post_types;
} );
```

## Requirements

- WordPress 6.0 or later.
- Tested compatible up to WordPress 7.00. The WordPress.org readme header uses the standard format `Tested up to: 7.0`.
- PHP 8.1 or later.


## Revision-safe selected post clean-up

Version 1.4.0 adds a controlled clean-up action inside **AgizoAI HTML AI Clean Up > HTML Scan**. After scanning content, an authorised editor can select specific flagged posts, choose a preset and run **Clean selected posts**.

The action uses a WordPress AJAX nonce, checks `edit_posts`, checks `edit_post` for every selected post, limits the number of posts processed per request, and creates a WordPress revision backup before each changed post is saved where revisions are supported. It does not publish drafts, change post status, send content externally or clean unselected posts.

Review the result table after running the action and open any updated post if manual checking is needed.

## Version 1.6.3 notes

Version 1.6.3 includes updated WordPress.org contributor metadata and the official plugin page URL while keeping the same privacy model, Editor Quality Tools and compliance-reviewed public packaging. The checks run locally, do not call external APIs and do not automatically save the post. The site-wide scanner now includes quality information so editors can identify posts that may need accessibility or SEO-safe HTML review as well as hidden AI/paste clean-up.


## Version 1.6.3 compliance notes

This release keeps the plugin privacy-first and WordPress.org-review friendly. It uses unique AGIZOHACU/agizohacu prefixes, sanitises registered settings, uses nonce and capability checks for admin/AJAX actions, escapes admin output, does not track users, does not call external APIs, does not register push notifications, does not cache pages and does not inject popups or front-end scripts.
