Remote Support LLC


WordPress Stuck on Publishing

Fixing WordPress Publishing Stuck Issue

wordpress stuck on publishing

If your WordPress site is stuck on “Publishing” when you try to publish or update a post, here are some steps to troubleshoot and fix the issue:

1. Check for Plugin Conflicts

  • Disable all plugins temporarily via FTP or the WordPress dashboard (if accessible).
    • Go to Plugins > Installed Plugins, then deactivate all.
    • Try publishing again. If it works, reactivate plugins one by one to find the culprit.
  • Common problematic plugins:
    • Security plugins (Wordfence, iThemes Security)
    • Caching plugins (WP Rocket, W3 Total Cache)
    • SEO plugins (Yoast SEO, Rank Math)
    • Performance optimization plugins

2. Switch to a Default Theme

  • Go to Appearance > Themes and switch to a default theme (e.g., Twenty Twenty-Four).
  • If publishing works, the issue is with your theme. Contact the theme developer for support.

3. Increase PHP Memory Limit

  • Edit wp-config.php (in your root WordPress folder) and add:phpCopydefine(‘WP_MEMORY_LIMIT’, ‘256M’);
  • Alternatively, check with your hosting provider to increase PHP limits.

4. Check for JavaScript Errors

  • Open your browser’s Developer Tools (F12) and go to the Console tab.
  • Try publishing again—if errors appear, they may point to the issue.

5. Disable Gutenberg Editor (Temporarily)

  • Install the Classic Editor plugin to see if the block editor (Gutenberg) is causing the issue.

6. Check WordPress Heartbeat API

  • Some hosting providers throttle the Heartbeat API, causing delays.
  • Install the Heartbeat Control plugin to adjust its frequency.

7. Clear Browser & WordPress Cache

  • Clear your browser cache.
  • Clear any WordPress caching plugins (e.g., WP Super Cache, W3 Total Cache).
  • If using a CDN (Cloudflare), purge its cache.

8. Check Database Issues

  • Repair and optimize your WordPress database via phpMyAdmin:
    • Select your database, then click “Check All” > “Repair Table”.
  • Alternatively, use WP-Optimize or WP-DBManager plugins.

9. Update WordPress, Themes & Plugins

  • Ensure WordPress core, themes, and plugins are up to date.

10. Check for Server Timeouts

  • If your post is very large (many images, long content), the server may time out.
  • Try publishing a smaller post to test.
  • Contact your hosting provider to increase PHP max_execution_time.

11. Debug Mode (Advanced)

  • Enable debugging by adding to wp-config.php:phpCopydefine(‘WP_DEBUG’, true); define(‘WP_DEBUG_LOG’, true); define(‘WP_DEBUG_DISPLAY’, false);
  • Check wp-content/debug.log for errors.

12. Manual Publishing via Database (Last Resort)

  • If a post is stuck in “Pending” or “Draft,” you can manually change its status in phpMyAdmin:
    • Find the wp_posts table.
    • Locate your post and change post_status to publish.

Final Step: Contact Hosting Support

If none of the above works, your hosting provider may have server-side restrictions (mod_security, PHP limits, etc.). Contact them for assistance.

Let me know if you need help with any specific step! 🚀

it says http 403 forbidden xhr

If you’re seeing a 403 Forbidden error with XHR (XMLHttpRequest) when trying to publish or update a WordPress post, it usually means the server is blocking the request due to security restrictions. Here’s how to fix it:


1. Check for Security Plugins or Firewalls

  • Disable security plugins (Wordfence, Sucuri, iThemes Security) temporarily to see if they’re blocking the request.
  • If you’re using Cloudflare, check its Firewall Rules or Security Level (set it to “Essentially Off” temporarily).

2. ModSecurity (Apache Server)

  • Many hosting providers use ModSecurity, which can block legitimate requests.
  • Solution:
    • Check your server’s error logs (via cPanel > Error Logs or ask your host).
    • If ModSecurity is the issue, ask your host to whitelist the rule causing the block.

3. Check File Permissions

  • Incorrect file permissions can cause 403 errors.
  • Fix via FTP/SSH:
    • Set WordPress directories to 755:shCopyfind /path/to/wordpress -type d -exec chmod 755 {} \;
    • Set files to 644:shCopyfind /path/to/wordpress -type f -exec chmod 644 {} \;
    • wp-config.php should be 600 or 640.

4. .htaccess Misconfiguration

  • A corrupted .htaccess file can cause 403 errors.
  • Fix:
    • Rename .htaccess to .htaccess_backup (via FTP).
    • Try publishing again (WordPress will generate a new .htaccess).
    • If it works, manually restore your custom rules.

5. Check for Hotlinking Protection

  • Some hosts block AJAX requests if hotlinking protection is enabled.
  • Solution:
    • Disable hotlinking in cPanel > Hotlink Protection (if applicable).

6. Disable WordPress REST API Restrictions

  • Some security plugins block REST API requests.
  • Test:
    • Visit yoursite.com/wp-json/ – if it shows a 403 error, something is blocking the API.
  • Fix:
    • Whitelist REST API in security plugins or .htaccess.

7. Browser & Cache Issues

  • Clear your browser cache or try in Incognito Mode.
  • Disable browser extensions (like ad blockers) that may interfere.

8. Check for XML-RPC Blocking

  • Some hosts block xmlrpc.php (used by WordPress for remote requests).
  • Test:
    • Visit yoursite.com/xmlrpc.php – if it’s blocked, ask your host to unblock it.

9. Server-Level Firewall (Hosting Provider)

  • Contact your hosting support and ask:
    • “Why am I getting a 403 Forbidden on WordPress AJAX (XHR) requests?”
    • “Is ModSecurity or a firewall blocking my requests?”
    • “Can you check the server logs for blocked requests?”

10. Debug with Developer Tools

  • Open Chrome DevTools (F12) > Network tab.
  • Try publishing and check the failing XHR request:
    • Look for response headers (may show which security rule blocked it).
    • Check the exact URL being blocked.

Final Fixes

  • If the issue persists, try:
    • Temporarily switching to default theme (Twenty Twenty-Four).
    • Increasing PHP memory limit (wp-config.php):phpCopydefine(‘WP_MEMORY_LIMIT’, ‘256M’);
    • Disabling Gutenberg (install Classic Editor plugin).

Let me know if you need help with any specific step! 🛠️

anything here causing it : # BEGIN WordPress # The directives (lines) between “BEGIN WordPress” and “END WordPress” are # dynamically generated, and should only be modified via WordPress filters. # Any changes to the directives between these markers will be overwritten. <IfModule mod_rewrite.c> RewriteEngine On RewriteRule .* – [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}] RewriteBase /wordpress/ RewriteRule ^index\.php$ – [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /wordpress/index.php [L] </IfModule>

The .htaccess rules you’ve shared are standard WordPress rewrite rules and are unlikely to be the cause of the 403 Forbidden XHR error. These rules handle pretty permalinks and should not block AJAX (XHR) requests.

However, let’s verify a few things:

1. Check if /wordpress/ is the Correct Path

  • Your RewriteBase /wordpress/ suggests WordPress is installed in a subdirectory (/wordpress/).
  • If WordPress is actually installed in the root directory, this could cause issues.
    Fix: If WordPress is in root, change to:apacheCopyRewriteBase / RewriteRule . /index.php [L]

2. Missing mod_rewrite or Incorrect Permissions

  • If mod_rewrite is disabled on your server, WordPress AJAX requests might fail.
    Check if mod_rewrite is enabled:shCopyapache2ctl -M | grep rewrite(If not enabled, ask your host to enable it.)

3. Conflicts with Other .htaccess Rules

  • Sometimes, other rules (outside the # BEGIN WordPress section) can interfere.
    Temporarily rename .htaccess to test:shCopymv .htaccess .htaccess_backup
    • Try publishing again.
    • If it works, regenerate .htaccess via Settings > Permalinks > Save.

4. Check for mod_security or Server Firewall

  • Most 403 Forbidden XHR errors come from:
    • ModSecurity (server-level firewall blocking AJAX requests).
    • Cloudflare/WAF rules (if using a CDN).
    • Hosting security policies (e.g., blocking admin-ajax.php).

Solution:

  • Check server error logs (cPanel > Error Logs or /var/log/apache2/error.log).
  • Ask your host:“My WordPress site is getting a 403 Forbidden on AJAX requests (XHR). Can you check if ModSecurity or a firewall is blocking admin-ajax.php?”

5. Test admin-ajax.php Directly

  • Visit this URL in your browser (replace with your domain):Copyhttps://yoursite.com/wordpress/wp-admin/admin-ajax.php?action=test
    • If it returns 403, the server is blocking it.
    • If it returns 0, WordPress is working correctly (and the issue is likely plugin/theme-related).

Next Steps

  1. Temporarily disable all plugins (could be a security plugin blocking requests).
  2. Switch to a default theme (Twenty Twenty-Four) to rule out theme issues.
  3. Contact your hosting support (most 403 XHR errors are server-side).

Let me know if you find any server logs or need help debugging further! 🔍

AH00558: apache2: Could not reliably determine the server’s fully qualified domain name, using atrc.net.pk. Set the ‘ServerName’ directive globally to suppress this message

The AH00558 Apache warning is not directly related to your WordPress 403 Forbidden XHR error, but it indicates a minor misconfiguration in your Apache server setup.

What Does This Warning Mean?

  • Apache expects a ServerName directive (your primary domain) in its config files.
  • If missing, Apache uses the server’s hostname (atrc.net.pk in your case) as a fallback.
  • This does not break WordPress, but it’s best practice to fix it.

How to Fix the AH00558 Warning

1. Set ServerName in Apache’s Config

  • Edit the main Apache config file (location varies by OS):
    • Ubuntu/Debian:shCopysudo nano /etc/apache2/apache2.conf
    • CentOS/RHEL:shCopysudo nano /etc/httpd/conf/httpd.conf
  • Add this line (replace yourdomain.com with your actual domain):apacheCopyServerName yourdomain.com
  • Save and restart Apache:shCopysudo systemctl restart apache2 # Ubuntu/Debian sudo systemctl restart httpd # CentOS/RHEL

2. Alternative: Set in Virtual Host File

If you’re using virtual hosts, define ServerName there:

apache

Copy

<VirtualHost *:80>
    ServerName yourdomain.com
    ServerAlias www.yourdomain.com
    DocumentRoot /var/www/html
    # Other directives...
</VirtualHost>

Restart Apache after changes.


But What About the 403 Forbidden XHR Error?

Since this warning is unrelated, your 403 error is likely caused by:

  1. ModSecurity (Apache’s firewall) blocking admin-ajax.php.
    • Check Apache error logs:shCopysudo tail -n 50 /var/log/apache2/error.log
    • Look for entries like ModSecurity: Access denied or AH01797.
    • Ask your host to whitelist the rule causing the block.
  2. File Permissions
    • Ensure wp-admin/admin-ajax.php is readable:shCopychmod 644 /path/to/wordpress/wp-admin/admin-ajax.php
  3. Plugin/Theme Conflict
    • Test with all plugins disabled and a default theme (Twenty Twenty-Four).
  4. Cloudflare/WAF
    • If using Cloudflare, temporarily pause it to test.

Summary

  1. Fix the AH00558 warning by setting ServerName (optional but recommended).
  2. Debug the 403 XHR error by:
    • Checking ModSecurity logs.
    • Disabling security plugins/firewalls.
    • Testing with default WordPress files.

Let me know if you find specific errors in the logs! 🚀

XHRGET https://remote-support.space/wordpress/wp-json/wp/v2/types?context=view&_locale=user [HTTP/1.1 403 Forbidden 283ms] GET https://remote-support.space/wordpress/wp-json/wp/v2/types?context=view&_locale=user Status 403 Forbidden VersionHTTP/1.1 Transferred724 B (90 B size) Referrer Policystrict-origin-when-cross-origin DNS ResolutionSystem HTTP/1.1 403 Forbidden Date: Fri, 04 Apr 2025 10:41:38 GMT Server: Apache/2.4.57 (Ubuntu) X-Robots-Tag: noindex Link: <https://remote-support.space/wordpress/wp-json/>; rel=”https://api.w.org/” X-Content-Type-Options: nosniff Access-Control-Expose-Headers: X-WP-Total, X-WP-TotalPages, Link Access-Control-Allow-Headers: Authorization, X-WP-Nonce, Content-Disposition, Content-MD5, Content-Type Expires: Wed, 11 Jan 1984 05:00:00 GMT Cache-Control: no-cache, must-revalidate, max-age=0 Vary: Origin Content-Length: 90 Keep-Alive: timeout=5, max=71 Connection: Keep-Alive Content-Type: application/json; charset=UTF-8 Accept application/json, */*;q=0.1 Accept-Encoding gzip, deflate, br, zstd Accept-Language en-US,en;q=0.5 Connection keep-alive Cookie wp-settings-1=libraryContent%3Dbrowse%26posts_list_mode%3Dlist; wp-settings-time-1=1743570566 Host remote-support.space Priority u=4 Referer https://remote-support.space/wordpress/wp-admin/post-new.php Sec-Fetch-Dest empty Sec-Fetch-Mode cors Sec-Fetch-Site same-origin User-Agent Mozilla/5.0 (X11; Linux x86_64; rv:132.0) Gecko/20100101 Firefox/132.0 X-WP-Nonce ce85aed370

The 403 Forbidden error when accessing /wp-json/wp/v2/types (WordPress REST API) is typically caused by server security rules blocking access. Here’s how to diagnose and fix it:


1. Check for ModSecurity Blocking (Most Likely Cause)

  • ModSecurity (Apache’s firewall) often blocks REST API requests.
  • How to confirm:
    • Check Apache error logs:shCopysudo tail -n 50 /var/log/apache2/modsec_audit.log
    • Look for entries like:CopyModSecurity: Access denied with code 403 (phase 2). Matched “some_rule_id” at REQUEST_URI.
  • Fix:
    • Ask your hosting provider to:
      • Whitelist the rule causing the block.
      • Temporarily disable ModSecurity to test.

2. Verify REST API Access

  • Manually test the REST API endpoint:shCopycurl -I https://remote-support.space/wordpress/wp-json/wp/v2/types
    • If it returns 403, the issue is server-side.
    • If it returns 200, the issue is client-side (e.g., browser/plugin conflict).

3. Check .htaccess Overrides

  • Ensure Apache allows .htaccess overrides for the /wordpress/ directory.
  • Edit /etc/apache2/apache2.conf (or your site’s virtual host file) and verify:apacheCopy<Directory /var/www/html/wordpress> AllowOverride All Require all granted </Directory>
  • Restart Apache:shCopysudo systemctl restart apache2

4. Disable Security Plugins

  • Temporarily deactivate Wordfence, iThemes Security, or Sucuri (if installed).
  • Clear any caching plugins (e.g., WP Rocket, W3 Total Cache).

5. Fix File Permissions

  • Ensure WordPress files are readable by Apache:shCopychmod -R 755 /var/www/html/wordpress chown -R www-data:www-data /var/www/html/wordpress

6. Test with Default .htaccess

  • Rename your current .htaccess:shCopymv /var/www/html/wordpress/.htaccess /var/www/html/wordpress/.htaccess_backup
  • Let WordPress regenerate a fresh .htaccess by visiting Settings > Permalinks > Save.

7. Check for Cloudflare/WAF Rules

  • If using Cloudflare, check:
    • Security > WAF for blocked requests.
    • Firewall Rules for restrictive policies.
  • Temporarily pause Cloudflare to test.

8. Debug WordPress REST API

  • Add this to wp-config.php to log REST API errors:phpCopydefine(‘WP_DEBUG’, true); define(‘WP_DEBUG_LOG’, true);
  • Check wp-content/debug.log for clues.

9. Ask Your Hosting Provider

If all else fails, contact support and share:

“My WordPress REST API (/wp-json/wp/v2/types) returns 403 Forbidden. Please check ModSecurity, Apache logs, or firewall rules blocking this request.”


Final Notes

  • The AH00558 warning (missing ServerName) is unrelated but should still be fixed.
  • The 403 error is almost always server-side (ModSecurity, permissions, or firewall).

Let me know if you find specific errors in the logs! 🔍

If it returns 200, the issue is client-side (e.g., browser/plugin conflict).

If your curl -I test returns a 200 OK response for the REST API endpoint (/wp-json/wp/v2/types), but you’re still seeing a 403 Forbidden error in the browser, the issue is client-side. Here’s how to diagnose and fix it:


1. Clear Browser Cache & Test in Incognito Mode

  • Browsers cache 403 errors aggressively.
  • Press Ctrl+Shift+Del (Windows/Linux) or Cmd+Shift+Del (Mac) to clear cache.
  • Try in Incognito/Private Mode (extensions disabled).

2. Disable Browser Extensions

  • Ad blockers (uBlock Origin), privacy tools (Privacy Badger), or security extensions can block wp-json requests.
  • Disable all extensions and retest.

3. Check for Plugin Conflicts

  • Security plugins (Wordfence, iThemes Security, Sucuri) may block REST API for non-admin users.
  • Performance/caching plugins (WP Rocket, W3 Total Cache) can corrupt AJAX requests.
  • Fix:
    • Go to Plugins > Installed Plugins, deactivate all plugins.
    • Test the REST API again.
    • Reactivate plugins one by one to find the culprit.

4. Verify WordPress Nonce (X-WP-Nonce)

  • The X-WP-Nonce header (visible in your DevTools request) must be valid for authenticated requests.
  • If you’re logged into WordPress but still get 403:
    • Open DevTools (F12) > Console, check for JavaScript errors.
    • Try logging out and back in to refresh the nonce.

5. Test Another Browser/Device

  • Try accessing https://remote-support.space/wordpress/wp-json/wp-v2/types in:
    • Firefox, Chrome, or Edge.
    • A mobile device (or use devtools’ Device Mode).

6. Check for Mixed Content (HTTPS/HTTP)

  • If your site uses HTTPS, but some resources load over HTTP, browsers may block requests.
  • Fix:
    • Ensure Site Address and WordPress Address in Settings > General use https://.
    • Add this to wp-config.php:phpCopydefine(‘FORCE_SSL_ADMIN’, true);

7. Debug JavaScript Errors

  • Open DevTools (F12) > Console and look for errors when loading the editor.
  • Common issues:
    • Failed to load resource: 403 (blocked by security rules).
    • TypeError: wp.api is undefined (REST API not loading).

8. Disable Gutenberg Editor (Temporarily)

  • Install the Classic Editor plugin to rule out Gutenberg bugs.
  • If the issue disappears, the problem is with:
    • Gutenberg compatibility.
    • A block plugin misbehaving.

9. Check CORS Headers (If Using External Requests)

  • If the error occurs only when accessing the API from an external site, ensure:apacheCopy# In .htaccess or Apache config Header set Access-Control-Allow-Origin “*”(Only use * for development!)

10. Last Resort: Reinstall WordPress Core

  • Download a fresh copy of WordPress from wordpress.org.
  • Replace all files except:
    • wp-config.php
    • wp-content/
  • Retest the REST API.

Summary of Client-Side Fixes

IssueFix
Browser cacheClear cache or use Incognito Mode.
ExtensionsDisable ad blockers/privacy tools.
Plugin conflictsDeactivate all plugins, test, and reactivate one by one.
Invalid nonceLog out and back in; check JS errors.
Mixed contentForce HTTPS in wp-config.php.
Gutenberg bugsSwitch to Classic Editor temporarily.

If the issue persists, share Console errors or new logs for further debugging! 🛠️

private window works

Since the WordPress REST API (/wp-json) works in a private/incognito window but fails in your normal browser, the issue is client-side. Here’s a step-by-step solution:


1. Browser Cache or Corrupted Data

Your main browser session may have cached a stale or corrupted response.
Fix:

  • Hard-refresh the page:
    • Windows/Linux: Press Ctrl + Shift + R
    • Mac: Press Cmd + Shift + R
  • Clear WordPress nonce/cookies:
    • Log out of WordPress and log back in.

2. Browser Extensions Interfering

Extensions (ad blockers, privacy tools, security plugins) often block wp-json requests.
Fix:

  1. Open your browser’s Extensions/Add-ons page.
    • Chrome: chrome://extensions/
    • Firefox: about:addons
  2. Disable all extensions temporarily.
  3. Test again. If it works, re-enable extensions one by one to find the culprit.

Common offenders:

  • uBlock Origin
  • Privacy Badger
  • Ghostery
  • Security extensions (e.g., Avast, Malwarebytes)

3. Corrupted Browser Profile

Your browser’s profile data may be causing conflicts.
Fix:

  • Firefox: Create a new profile via about:profiles.
  • Chrome: Try a guest profile.

4. WordPress Admin Nonce Issue

If you’re logged into WordPress, the X-WP-Nonce (used for API authentication) might be invalid.
Fix:

  1. Open DevTools (F12) > Console and check for errors like:
    • Invalid nonce
    • 403 Forbidden on admin-ajax.php
  2. Log out and log back in to refresh the nonce.

5. Cached REST API Responses

Caching plugins (e.g., WP Rocket, W3 Total Cache) or server-level caching (Redis, Varnish) may serve stale API responses.
Fix:

  • Clear all caching plugins.
  • Temporarily disable caching and test again.

6. Check for Mixed Content (HTTP/HTTPS)

If your site uses HTTPS but some requests are forced to HTTP, browsers may block them.
Fix:

  1. Ensure both URLs in Settings > General use https://:
    • WordPress Address
    • Site Address
  2. Add this to wp-config.php:phpCopydefine(‘FORCE_SSL_ADMIN’, true);

7. Debug Steps if Issue Persists

  1. Test in another browser (e.g., Firefox if you use Chrome).
  2. Check DevTools (F12) > Network tab:
    • Look for (blocked:reason) next to the failed request.
  3. Disable all plugins (temporarily) to rule out conflicts.

Final Fix: Reset Browser

If nothing works, reset your browser:

  • Chrome: chrome://settings/reset
  • Firefox: about:support > Refresh Firefox

Summary of Solutions

IssueQuick Fix
Cached dataHard refresh (Ctrl+Shift+R) or clear cookies.
Browser extensionsDisable all extensions, test in Incognito.
Invalid nonceLog out and back in. Check DevTools for errors.
Mixed contentForce HTTPS in wp-config.php.
Corrupted profileTry a new browser profile or different browser.

Let me know if you find any Console errors after testing! 🚀

solved cache cleared and it worked. Thank you very much 🙂

You’re very welcome! I’m glad clearing the cache resolved the issue. 🎉

Quick Recap of the Fix:

Problem: The WordPress REST API (/wp-json) returned 403 Forbidden due to cached corrupted data in your browser.
Solution: A hard refresh (Ctrl+Shift+R) or clearing browser cache/cookies fixed it.

To Prevent Future Issues:

  1. Regularly clear cache (especially after WordPress updates).
  2. Use Incognito Mode for testing (avoids extension conflicts).
  3. Check DevTools (F12) > Network tab if API requests fail again.

If you run into more WordPress hiccups, feel free to ask—happy to help! 😊

Enjoy your smooth WordPress experience! 🚀

Loading