Introduction

The WordPress classic editor saves posts through AJAX requests to the admin-ajax.php endpoint. When saving fails, users lose work and experience frustration. Common causes include autosave conflicts with manual saves, revision post type limits being reached, JavaScript errors preventing AJAX calls, plugin hooks interfering with save operations, PHP memory limits exceeded during save, and database connection issues. Understanding the save process, debugging AJAX responses, and identifying conflicting plugins is essential for resolving classic editor save problems.

Symptoms

When WordPress classic editor fails to save, you will observe:

  • "Save Draft" or "Publish" button doesn't respond
  • Spinner animation continues indefinitely
  • Error message: "Saving failed" or "Connection lost"
  • Changes disappear after page refresh
  • Autosave not working or creating duplicates
  • Revision history shows gaps

Browser console errors: `` POST /wp-admin/admin-ajax.php 500 (Internal Server Error) Uncaught TypeError: wp.autosave.save is not a function

WordPress admin-ajax.php response: ``json { "success": false, "data": { "wp_error": "Database error", "message": "Sorry, you are not allowed to edit this post." } }

Common Causes

  1. 1.JavaScript conflict - Plugin or theme JS breaking save function
  2. 2.Autosave conflict - Autosave interrupting manual save
  3. 3.Revision limit reached - Maximum revisions exceeded
  4. 4.Database write failure - Table corruption or connection issue
  5. 5.Memory limit exceeded - PHP memory exhausted during save
  6. 6.Plugin hook conflict - save_post hook causing issues
  7. 7.Nonce verification failure - Security nonce invalid
  8. 8.User capability issue - User lacks edit permissions
  9. 9.POST size limit - Content too large
  10. 10.ModSecurity blocking - WAF blocking save requests

Step-by-Step Fix

Step 1: Enable Debugging

Enable WordPress debugging to see errors:

bash
# Edit wp-config.php
vim wp-config.php

Add these lines: ``php define('WP_DEBUG', true); define('WP_DEBUG_LOG', true); define('WP_DEBUG_DISPLAY', false);

Check debug log: ``bash tail -f wp-content/debug.log

Also check browser console for JavaScript errors: `` Press F12 > Console tab Look for red error messages

Step 2: Test JavaScript Conflicts

Check for JavaScript errors preventing save:

```javascript // In browser console, test save function wp.autosave.save(); // Should return true if working

// Check if autosave exists console.log(typeof wp.autosave); // Should output: object ```

If JavaScript errors are found: ```bash # Check theme's JavaScript files ls -la wp-content/themes/your-theme/js/

# Check plugin JavaScript find wp-content/plugins -name "*.js" -exec grep -l "autosave|save" {} \;

# Test with all plugins disabled # Rename plugins folder temporarily mv wp-content/plugins wp-content/plugins-disabled mkdir wp-content/plugins ```

Step 3: Fix Autosave Settings

Configure autosave to prevent conflicts:

```php // In wp-config.php, disable autosave define('AUTOSAVE_INTERVAL', 300); // Change to 5 minutes (default 60 seconds) define('WP_POST_REVISIONS', 10); // Limit revisions

// Or completely disable autosave define('AUTOSAVE_INTERVAL', 86400); // Once per day ```

In functions.php, disable autosave for specific post types: ``php function disable_autosave_for_cpt() { if (get_post_type() === 'your_custom_post_type') { wp_deregister_script('autosave'); } } add_action('admin_enqueue_scripts', 'disable_autosave_for_cpt');

Step 4: Fix Revision Issues

Check and fix revision problems:

```sql -- Check post revisions count SELECT post_parent, COUNT(*) as revision_count FROM wp_posts WHERE post_type = 'revision' GROUP BY post_parent HAVING revision_count > 10;

-- Delete excess revisions (keep last 5) DELETE r1 FROM wp_posts r1 INNER JOIN wp_posts r2 ON r1.post_parent = r2.post_parent WHERE r1.post_type = 'revision' AND r2.post_type = 'revision' AND r1.post_date < r2.post_date AND (SELECT COUNT(*) FROM wp_posts r3 WHERE r3.post_parent = r1.post_parent AND r3.post_type = 'revision') > 5; ```

Using WP-CLI: ```bash # Clean up post revisions wp post delete $(wp post list --post_type='revision' --format=ids) --force

# Set revision limit wp option update wp_post_revisions 5 ```

Step 5: Increase PHP Resources

Increase memory and limits for saving:

php
// In wp-config.php
define('WP_MEMORY_LIMIT', '512M');
define('WP_MAX_MEMORY_LIMIT', '512M');

Create or edit .user.ini in WordPress root: ``ini memory_limit = 512M max_execution_time = 300 max_input_vars = 3000 post_max_size = 64M

For PHP-FPM, increase limits: ```bash # Edit PHP-FPM pool config sudo vim /etc/php/8.2/fpm/pool.d/www.conf

# Increase limits php_admin_value[memory_limit] = 512M php_admin_value[max_execution_time] = 300 ```

Step 6: Fix Plugin Conflicts

Identify plugins causing save issues:

```bash # List active plugins wp plugin list --status=active

# Test by deactivating all plugins wp plugin deactivate --all

# Test save - if works, re-activate one by one wp plugin activate plugin-name ```

Check for save_post hook conflicts: ``bash # Find plugins hooking into save_post grep -r "save_post|publish_post|wp_insert_post" wp-content/plugins/

Common problematic hooks: ``php // This can cause infinite loop or blocking add_action('save_post', 'my_function'); function my_function($post_id) { // If this calls wp_update_post() without unhooking first... wp_update_post(array('ID' => $post_id, 'post_title' => 'Modified')); }

Fixed version: ``php add_action('save_post', 'my_function'); function my_function($post_id) { // Unhook to prevent infinite loop remove_action('save_post', 'my_function'); wp_update_post(array('ID' => $post_id, 'post_title' => 'Modified')); // Re-hook add_action('save_post', 'my_function'); }

Step 7: Fix Database Issues

Check and repair database tables:

```bash # Check database tables wp db check

# Repair tables wp db repair

# Check wp_posts table specifically mysql -u wordpress -p wordpress -e "CHECK TABLE wp_posts;"

# Repair if corrupted mysql -u wordpress -p wordpress -e "REPAIR TABLE wp_posts;" ```

Check for table locks: ``sql SHOW OPEN TABLES WHERE In_use > 0; SHOW PROCESSLIST; -- Kill any long-running queries blocking saves

Step 8: Fix Nonce and Permission Issues

Check user permissions and nonce:

```bash # Check user capabilities wp user list --fields=ID,user_login,user_email --role=administrator

# Check if user can edit posts wp user meta get 1 wp_capabilities ```

In browser console, check nonce: ``javascript // Check if nonce is valid console.log(wp.autosave.getPostID()); console.log(jQuery('#_wpnonce').val());

Refresh nonce by reloading page or: ``php // Force nonce refresh wp_create_nonce('update-post_' . $post_id);

Step 9: Check ModSecurity/WAF

Web Application Firewall may block save requests:

```bash # Check Apache/Nginx logs for blocked requests grep -i "modsecurity|403" /var/log/apache2/error.log | tail -20

# Check for POST blocking grep "POST.*admin-ajax.php.*403" /var/log/apache2/access.log ```

If ModSecurity is blocking: ```apache # Disable ModSecurity for wp-admin (not recommended for production) <Location /wp-admin/> SecRuleEngine Off </Location>

# Better: Whitelist specific rules SecRuleRemoveById 123456 ```

Step 10: Test AJAX Save Endpoint

Test save directly via AJAX:

bash
# Test admin-ajax.php response
curl -X POST 'https://yourdomain.com/wp-admin/admin-ajax.php' \
  -H 'Cookie: wordpress_logged_in_...=...' \
  -d 'action=autosave' \
  -d 'post_ID=123' \
  -d 'post_title=Test' \
  -d '_wpnonce=abc123'

Verification

After fixes, verify saving works:

  1. 1.Manual save test:
  2. 2.- Create new post
  3. 3.- Add content
  4. 4.- Click "Save Draft"
  5. 5.- Should see "Draft saved" message
  6. 6.Autosave test:
  7. 7.- Edit existing post
  8. 8.- Make changes but don't save
  9. 9.- Wait 60 seconds (or your autosave interval)
  10. 10.- Refresh page
  11. 11.- Changes should be in autosave
  12. 12.Revision test:
  13. 13.- Edit post multiple times
  14. 14.- Check revision history
  15. 15.- Should see all revisions

Check debug log is clean: ``bash tail wp-content/debug.log # Should be empty or only contain non-critical notices

Prevention

To prevent future save issues:

  1. 1.Limit revisions:
  2. 2.```php
  3. 3.define('WP_POST_REVISIONS', 5);
  4. 4.`
  5. 5.Schedule autosave cleanup:
  6. 6.```bash
  7. 7.# Cron job to clean old autosaves
  8. 8.0 0 * * * wp post delete $(wp post list --post_type='revision' --post_status='inherit' --date='1 month ago' --format=ids) --force
  9. 9.`
  10. 10.Monitor save failures:
  11. 11.```php
  12. 12.// Log failed saves
  13. 13.add_action('admin_notices', function() {
  14. 14.if (isset($_GET['message']) && $_GET['message'] == 'error') {
  15. 15.error_log('Post save failed: ' . $_GET['id']);
  16. 16.}
  17. 17.});
  18. 18.`
  19. 19.Use heartbeat to detect issues:
  20. 20.```php
  21. 21.add_filter('heartbeat_received', function($response, $data) {
  22. 22.if (!empty($data['wp-refresh-post'])) {
  23. 23.$response['wp-refresh-post']['save_status'] = 'ok';
  24. 24.}
  25. 25.return $response;
  26. 26.}, 10, 2);
  27. 27.`
  28. 28.Regular database maintenance:
  29. 29.```bash
  30. 30.# Weekly table optimization
  31. 31.wp db optimize
  32. 32.`
  33. 33.Keep plugins updated:
  34. 34.```bash
  35. 35.wp plugin update --all
  36. 36.`
  37. 37.Test in staging before updates:
  38. 38.- Always test major changes in staging environment
  39. 39.- Verify save functionality after theme/plugin updates
  • [WordPress troubleshooting: Fix Child Theme Not Enqueuing Parent Styles Correc](child-theme-not-enqueuing-parent-styles-correctly)
  • [Fix Database Connection Error Custom Socket Path Issue in WordPress](database-connection-error-custom-socket-path)
  • [Fix Debug Log Growing Deprecated Warnings Notices Issue in WordPress](debug-log-growing-deprecated-warnings-notices)
  • [Fix Fix Contact Form Not Sending On Wordpress Site Issue in WordPress](fix-contact-form-not-sending-on-wordpress-site)
  • [Fix Fix Open Basedir Restriction Blocking Wordpress Issue in WordPress](fix-open-basedir-restriction-blocking-wordpress)

<script type="application/ld+json"> { "@context": "https://schema.org", "@type": "TechArticle", "headline": "WordPress Classic Editor Not Saving", "description": "Fix WordPress classic editor save issues. Troubleshoot autosave, revisions, AJAX errors, and plugin conflicts.", "url": "https://www.fixwikihub.com/fix-wordpress-classic-editor-not-saving", "publisher": { "@type": "Organization", "name": "FixWikiHub", "url": "https://www.fixwikihub.com" }, "author": { "@type": "Person", "name": "FixWikiHub Editorial Team" }, "datePublished": "2025-12-08T23:29:37.279Z", "dateModified": "2025-12-08T23:29:37.279Z" } </script>