I'm ready to get with the times and make sure my sites are using the block editor for all of the pages.
One of my motivators is I had an admin's password get cracked on a site, and someone used their account to add spammy content in hidden divs on several pages. The block editor makes that painfully easy to find when you look at it, while the classic editor requires switching to HTML mode and scanning the whole thing.
So anyway, the site has a LOT of pages, and converting them will take time. Is there an easy way to track which ones have been done? Something I can search on to tell which pages still use the classic editor and which are fully converted?
I'm ready to get with the times and make sure my sites are using the block editor for all of the pages.
One of my motivators is I had an admin's password get cracked on a site, and someone used their account to add spammy content in hidden divs on several pages. The block editor makes that painfully easy to find when you look at it, while the classic editor requires switching to HTML mode and scanning the whole thing.
So anyway, the site has a LOT of pages, and converting them will take time. Is there an easy way to track which ones have been done? Something I can search on to tell which pages still use the classic editor and which are fully converted?
block-editor
classic-editor
Share
Improve this question
asked Apr 17 at 21:01
justdavejustdave311 bronze badge
Add a comment
|
2 Answers
2
Reset to default
0
To track which pages on your WordPress site still use the Classic Editor versus those converted to the Block Editor, you can use a combination of manual checks, plugins, and database queries. Here’s a concise guide to help you identify and manage the conversion process, addressing your security concerns about spammy content and the need for efficient tracking:
1. Use a Plugin to Identify Classic Editor Content
Convert to Blocks Plugin: Install the "Convert to Blocks" plugin, which transforms Classic Editor content into blocks on-the-fly when a post is edited. It doesn’t automatically identify unconverted pages but can help during manual edits. When you edit a page, it will show if it’s in a Classic block (indicating it hasn’t been fully converted). You can then convert it to individual blocks.
Bulk Conversion Option: This plugin also offers a WP-CLI command (wp convert-to-blocks start) for bulk conversion, which can be useful for large sites. However, it doesn’t provide a direct list of unconverted pages, so you’d need to track progress manually or via other methods below. Note: Create a full site backup before bulk conversion, as it’s irreversible.
2. Check the Editor Icon in the Posts/Pages Admin Screen
In your WordPress dashboard, go to Posts or Pages. The list view includes an icon next to each item indicating the editor used:
A pencil icon typically indicates the Classic Editor or a Classic block.
A block-like icon (grid or stacked lines) indicates the Block Editor.
You can sort or filter this list to visually identify which pages are still using the Classic Editor. This is manual but straightforward for smaller batches.
3. Query the Database for Classic Editor Content
For a programmatic approach, you can query the WordPress database to find pages with Classic Editor content (often stored as a single Classic block or raw HTML). Here’s how:
Access your database via a tool like phpMyAdmin or a plugin like WP phpMyAdmin.
Run a SQL query to search the wp_posts table for posts/pages containing Classic block markers. For example:
SELECT ID, post_title, post_type
FROM wp_posts
WHERE post_content LIKE '%<!-- wp:classic %'
AND post_type IN ('post', 'page')
AND post_status = 'publish';
This searches for the <!-- wp:classic comment, which indicates a Classic block in the Block Editor. Pages without this marker are likely fully converted to individual blocks.
Note: Replace wp_ with your database’s prefix if it’s different. Always back up your database before running queries.
This method gives you a precise list of pages needing conversion, which you can export as a CSV for tracking.
4. Use a Custom Script or Plugin to Flag Unconverted Pages
If you’re comfortable with coding, you can create a custom script or use a plugin like Code Snippets to add a column to the Posts/Pages admin screen that flags whether a page uses the Classic Editor. Here’s a basic example:
This adds a column to the Pages admin screen labeling each page as “Classic” or “Block” based on the presence of a Classic block. Adapt this for posts by changing manage_pages to manage_posts.
5. Track Conversion Progress
Manual Tracking: Maintain a spreadsheet or use a project management tool to log pages as you convert them. Cross-reference with the Posts/Pages admin screen or database query results.
Semi-Automated Tracking: If using the Convert to Blocks plugin, you can process pages in batches (e.g., 20 at a time) and check the admin screen’s editor icon to confirm conversion. One user reported opening 20 posts in tabs, updating them, and verifying the block icon afterward to avoid server issues.
Custom Meta Field: Add a custom meta field to track conversion status. For example, use a plugin like Advanced Custom Fields to create a “Converted to Blocks” checkbox. Update this field as you convert each page, then filter or query pages based on this meta field.
Security Considerations
Why Block Editor Helps: As you noted, the Block Editor’s visual interface makes hidden divs or spammy content (like those added via a compromised admin account) easier to spot compared to scanning HTML in the Classic Editor’s Text mode. Converting to blocks ensures content is structured, reducing the risk of hidden malicious code.
Prevent Future Issues:
Enforce strong passwords and two-factor authentication (2FA) for all admin accounts using plugins like Wordfence or iThemes Security.
Regularly scan for malware with plugins like Sucuri or Wordfence to detect hidden divs or scripts.
Update WordPress, themes, and plugins to the latest versions to patch security vulnerabilities.
Audit Content: After conversion, use a plugin like Yoast SEO or Rank Math to review content structure and ensure no spammy elements remain. The Block Editor’s clear block structure aids this process.
Recommendations
Start with the Database Query: This is the most efficient way to generate a list of unconverted pages, especially for a site with many pages. Export the results and use them as your conversion checklist.
Use Convert to Blocks for Bulk Processing: If you’re comfortable with WP-CLI, use the bulk conversion command for faster processing, but test on a staging site first to avoid issues.
Combine with Admin Screen Checks: Regularly check the Posts/Pages admin screen to monitor progress and verify conversions.
Backup and Test: Always back up your site before bulk conversions or database changes. Test conversions on a staging site to ensure compatibility with your theme and plugins.
By combining these methods, you can systematically track and convert your pages while enhancing site security against spammy content. If you need help setting up the SQL query or custom script, let me know, and I can guide you further!
There are 2 ways to do this. There is a plugin that will detect gutenberg pages. Better though is if you place this code in your functions.php it will add a column to your admin page of your pages list telling you which pages are using the block editor and which are using classic.