Skip to content
  • Quick Ref
  • Contact
  • About
wpcanyon.com

wpcanyon.com

Category: Fixes & Errors

Fix WordPress too many redirects (ERR_TOO_MANY_REDIRECTS)

Posted on August 19, 2025 By Admin No Comments on Fix WordPress too many redirects (ERR_TOO_MANY_REDIRECTS)

Fix WordPress too many redirects (ERR_TOO_MANY_REDIRECTS)

If you encounter the ERR_TOO_MANY_REDIRECTS error on your WordPress site, it means your browser is stuck in an infinite redirect loop. This prevents your site from loading properly and frustrates visitors. The quick fix usually involves correcting your WordPress URL settings or your server’s redirect rules.

Quick Fix

  1. Access your WordPress database via phpMyAdmin or a similar tool.
  2. Locate the wp_options table.
  3. Find the siteurl and home entries.
  4. Ensure both URLs use the same protocol (http or https) and domain, for example: https://example.com.
  5. Clear your browser cache and cookies.
  6. If you use a caching or redirect plugin, temporarily disable it.

Alternatively, you can add the following lines to your wp-config.php file to hardcode the URLs:

define('WP_HOME','https://example.com');
define('WP_SITEURL','https://example.com');

Replace https://example.com with your actual site URL.

Why This Happens

The ERR_TOO_MANY_REDIRECTS error occurs when your browser is redirected between URLs repeatedly without reaching the final destination. Common causes include:

  • Mismatched URL settings: WordPress URL settings use HTTP while your site forces HTTPS (or vice versa).
  • Conflicting redirect rules: Server-level redirects (in .htaccess or Nginx config) conflict with WordPress or plugin redirects.
  • Plugin conflicts: Plugins that handle redirects or SSL can cause loops if misconfigured.
  • Incorrect SSL setup: Partial SSL implementation or mixed content issues.

Step-by-step Fix for Nginx and Apache (cPanel/Plesk)

1. Check WordPress URL Settings

Make sure WordPress URLs are consistent and correct.

-- Access your database via phpMyAdmin or command line
SELECT option_name, option_value FROM wp_options WHERE option_name IN ('siteurl', 'home');

-- Update URLs if needed
UPDATE wp_options SET option_value = 'https://example.com' WHERE option_name = 'siteurl';
UPDATE wp_options SET option_value = 'https://example.com' WHERE option_name = 'home';

2. Fix wp-config.php (optional)

Add these lines to enforce correct URLs:

define('WP_HOME','https://example.com');
define('WP_SITEURL','https://example.com');

3. Review Apache .htaccess Redirects (cPanel/Plesk)

Check your .htaccess file in the WordPress root directory for conflicting redirects. A typical WordPress .htaccess looks like this:

# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress

If you have HTTPS redirects, ensure they are correct and not looping:

# Redirect HTTP to HTTPS
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://%{HTTP_HOST}/$1 [R=301,L]

4. Review Nginx Redirects

Check your Nginx server block configuration for redirect loops. A proper HTTPS redirect looks like this:

server {
    listen 80;
    server_name example.com www.example.com;
    return 301 https://example.com$request_uri;
}

server {
    listen 443 ssl;
    server_name example.com www.example.com;

    ssl_certificate /path/to/cert.pem;
    ssl_certificate_key /path/to/key.pem;

    root /var/www/html;
    index index.php index.html index.htm;

    location / {
        try_files $uri $uri/ /index.php?$args;
    }

    location ~ .php$ {
        include snippets/fastcgi-php.conf;
        fastcgi_pass unix:/var/run/php/php7.4-fpm.sock;
    }
}

5. Disable Redirect or SSL Plugins

Temporarily deactivate plugins like Really Simple SSL, Redirection, or any caching plugins that might cause redirect loops.

6. Clear Browser and Server Cache

Clear your browser cache and cookies. Also clear any server-side caches (e.g., LiteSpeed cache, Varnish, or CDN caches).

Works on

  • Web servers: Apache, Nginx, LiteSpeed
  • Hosting control panels: cPanel, Plesk
  • WordPress versions: 4.x, 5.x, 6.x
  • SSL setups: Let’s Encrypt, commercial SSL certificates

FAQ

Q1: Why does ERR_TOO_MANY_REDIRECTS happen only on some browsers?

Browser cache or cookies can cause this error to appear inconsistently. Clearing cache and cookies usually resolves this.

Q2: Can a plugin cause redirect loops?

Yes. Plugins that manage redirects, SSL, or caching can conflict with server redirects or WordPress settings, causing loops.

Q3: How do I know if my SSL is causing the redirect loop?

If your WordPress URLs use HTTPS but your server redirects HTTP to HTTPS incorrectly or partially, it can cause loops. Verify SSL configuration and redirects.

Q4: Is it safe to hardcode URLs in wp-config.php?

Yes, hardcoding WP_HOME and WP_SITEURL is a quick way to fix URL mismatches but should be used carefully to avoid issues during migrations.

Q5: What if none of these fixes work?

Check your server error logs, disable all plugins and switch to a default theme to isolate the issue. Contact your hosting provider if needed.…

Fixes & Errors

Fix “Maximum execution time of 30 seconds exceeded” in WordPress

Posted on August 19, 2025 By Admin No Comments on Fix “Maximum execution time of 30 seconds exceeded” in WordPress

Fix “Maximum execution time of 30 seconds exceeded” in WordPress

If you encounter the error “Maximum execution time of 30 seconds exceeded” in WordPress, it means a PHP script is taking too long to run and is being stopped by the server. This often happens during plugin updates, backups, or importing large files. The quick fix is to increase the PHP maximum execution time limit so scripts have more time to complete.

Quick Fix

  1. Access your WordPress root directory via FTP or file manager.
  2. Edit or create a php.ini or .user.ini file.
  3. Add or update this line to increase the time limit (e.g., 300 seconds):
max_execution_time = 300
  1. If you cannot edit php.ini, add this line to your wp-config.php file instead:
set_time_limit(300);
  1. Save changes and test your site or process again.

Why This Happens

PHP scripts have a maximum execution time to prevent poorly written code from running indefinitely and overloading the server. The default is often set to 30 seconds on many shared hosting environments. When WordPress or a plugin runs a process that takes longer—like importing large data, running backups, or complex queries—the script hits this limit and stops, causing the error.

Increasing the max_execution_time gives scripts more time to finish. However, setting it too high may affect server performance, so adjust carefully based on your needs.

Step-by-step Guide to Fix the Error

1. Using php.ini or .user.ini (Recommended)

This method works if you have access to your PHP configuration files.

  1. Connect to your server using FTP or your hosting control panel file manager.
  2. Navigate to your WordPress root directory (where wp-config.php is located).
  3. Look for a php.ini or .user.ini file. If none exists, create a new file named php.ini or .user.ini.
  4. Edit the file and add or update the following line:
max_execution_time = 300

This sets the maximum execution time to 300 seconds (5 minutes).

  1. Save the file and upload it back to the server if using FTP.
  2. Restart your web server if you have control over it (not always possible on shared hosting).
  3. Test your WordPress site or the process that caused the error.

2. Using wp-config.php

If you cannot access or modify php.ini, you can try increasing the time limit via WordPress configuration.

  1. Access your WordPress root directory.
  2. Edit the wp-config.php file.
  3. Add the following line near the top, just after the opening <?php tag:
set_time_limit(300);
  1. Save the file and upload it back.
  2. Test your site or process again.

3. For Nginx Servers

Nginx does not use php.ini directly but you can increase PHP-FPM timeout settings.

  1. Access your server via SSH.
  2. Edit your PHP-FPM pool configuration file, usually located at:
/etc/php/7.x/fpm/pool.d/www.conf

(Replace 7.x with your PHP version.)

  1. Find and update these values:
request_terminate_timeout = 300s
max_execution_time = 300
  1. Save the file.
  2. Restart PHP-FPM and Nginx:
sudo systemctl restart php7.x-fpm
sudo systemctl restart nginx

Replace php7.x-fpm with your PHP-FPM service name.

4. For Apache Servers

Apache usually respects php.ini or .htaccess overrides.

  1. Access your WordPress root directory.
  2. Edit or create a .htaccess file.
  3. Add this line:
php_value max_execution_time 300
  1. Save and upload the file.
  2. Restart Apache if you have server access:
sudo systemctl restart apache2

On shared hosting, this restart is handled automatically.

5. Using cPanel

  1. Log in to your cPanel dashboard.
  2. Go to Select PHP Version or MultiPHP INI Editor.
  3. Find the max_execution_time setting.
  4. Increase the value to 300 or higher.
  5. Save changes.

6. Using Plesk

  1. Log in to your Plesk panel.
  2. Go to Domains > select your domain > PHP Settings.
  3. Find max_execution_time and increase it.
  4. Save changes.

Works on

Environment Applicable Fix
Apache (shared/dedicated) .htaccess, php.ini, wp-config.php
Nginx with PHP-FPM php.ini, PHP-FPM config, wp-config.php
cPanel Hosting
…
Fixes & Errors

Increase upload_max_filesize (Uploaded file exceeds the upload_max_filesize directive)

Posted on August 19, 2025 By Admin No Comments on Increase upload_max_filesize (Uploaded file exceeds the upload_max_filesize directive)

Increase upload_max_filesize (Uploaded file exceeds the upload_max_filesize directive)

If you encounter the error “Uploaded file exceeds the upload_max_filesize directive” in WordPress, it means your server’s PHP configuration limits the maximum file size you can upload. This often blocks you from uploading large media files or plugins. The quick fix is to increase the upload_max_filesize value in your PHP settings.

Quick Fix

  1. Edit your php.ini file (or create one if it doesn’t exist) and add or update this line:
    upload_max_filesize = 64M
  2. Also increase post_max_size to the same or larger value:
    post_max_size = 64M
  3. Restart your web server (Apache, Nginx, LiteSpeed) to apply changes.
  4. Verify the new limits in WordPress by going to Media > Add New or using a PHP info plugin.

Why this happens

PHP has built-in limits on file upload sizes to prevent server overload and abuse. The upload_max_filesize directive controls the maximum size of an uploaded file, while post_max_size controls the maximum size of POST data allowed. If your file exceeds these limits, PHP rejects the upload and WordPress shows the error.

By default, many hosting providers set these values low (e.g., 2MB or 8MB) to conserve resources. To upload larger files, you must increase these limits manually.

Step-by-step

1. For Apache or LiteSpeed servers

  1. Locate your php.ini file. Common locations:
    • /etc/php/7.x/apache2/php.ini
    • /usr/local/lib/php.ini
    • Use phpinfo() to find the loaded config file.
  2. Edit the php.ini file and update or add:
    upload_max_filesize = 64M
    post_max_size = 64M
    memory_limit = 128M
    max_execution_time = 300
    max_input_time = 300
  3. Save the file and restart Apache or LiteSpeed:
    sudo systemctl restart apache2
    # or for LiteSpeed
    sudo systemctl restart lsws
  4. Check changes with a PHP info file or WordPress media uploader.

2. For Nginx servers

  1. Edit your PHP-FPM php.ini file (location similar to Apache).
  2. Update the same directives as above:
    upload_max_filesize = 64M
    post_max_size = 64M
    memory_limit = 128M
    max_execution_time = 300
    max_input_time = 300
  3. Edit your Nginx site configuration file (e.g., /etc/nginx/sites-available/example.com) and add or update:
    client_max_body_size 64M;
  4. Restart PHP-FPM and Nginx:
    sudo systemctl restart php7.x-fpm
    sudo systemctl restart nginx
  5. Verify upload limits in WordPress.

3. Using cPanel

  1. Log in to your cPanel dashboard.
  2. Go to MultiPHP INI Editor under the Software section.
  3. Select your domain from the dropdown.
  4. Set upload_max_filesize and post_max_size to your desired values (e.g., 64M).
  5. Save the changes.
  6. Check your WordPress upload limits.

4. Using Plesk

  1. Log in to Plesk.
  2. Go to Domains > example.com > PHP Settings.
  3. Find upload_max_filesize and post_max_size and increase their values.
  4. Save the settings.
  5. Test upload limits in WordPress.

Works on

Server Control Panel Notes
Apache cPanel, Plesk, Manual Requires php.ini edit and server restart
Nginx cPanel, Plesk, Manual Requires php.ini and nginx.conf edits + restarts
LiteSpeed cPanel, Manual Similar to Apache, restart LiteSpeed after changes

FAQ

  1. Q: I increased upload_max_filesize but still get the error. Why?

    A: You must also increase post_max_size and ensure your web server (Nginx or Apache) allows larger uploads (e.g., client_max_body_size in Nginx). Restart your server after changes.

  2. Q: Can I increase upload limits via .htaccess?

    A: Only on Apache servers with PHP running as an Apache module. Add these lines to your .htaccess:

    php_value upload_max_filesize 64M
    php_value post_max_size 64M
  3. Q: How do I check current upload limits?

    A: Use a PHP info plugin in WordPress or create a phpinfo.php file with:

    <?php phpinfo(); ?>

    Then open it in your browser and look for upload_max_filesize

…
Fixes & Errors

Fix WordPress posts returning 404 (pages OK)

Posted on August 19, 2025 By Admin No Comments on Fix WordPress posts returning 404 (pages OK)

Fix WordPress posts returning 404 (pages OK)

If your WordPress posts are returning 404 errors while your pages load just fine, it can be a frustrating issue that disrupts your site’s functionality and user experience. The good news is this problem usually stems from permalink or rewrite rule issues, and you can fix it quickly by resetting your permalink structure or adjusting your server configuration.

Quick Fix

  1. Log in to your WordPress admin dashboard.
  2. Go to Settings > Permalinks.
  3. Without changing anything, click the Save Changes button at the bottom.
  4. Check your posts again; the 404 errors should be resolved.

Why this happens

This issue typically occurs because WordPress’s rewrite rules are out of sync or not properly flushed. WordPress uses rewrite rules to map URLs to the correct content. When these rules are corrupted, missing, or not updated, posts URLs can return 404 errors even though pages work fine.

Common causes include:

  • Changing permalink settings without flushing rewrite rules.
  • Server configuration changes or restrictions (e.g., missing .htaccess rules on Apache or incorrect Nginx configuration).
  • Plugin conflicts that modify rewrite rules.
  • File permission issues preventing WordPress from writing to the .htaccess file.

Step-by-step

1. Reset Permalinks in WordPress Dashboard

  1. Navigate to Settings > Permalinks.
  2. Click Save Changes without modifying any settings.

This action forces WordPress to flush and regenerate rewrite rules.

2. Check and Update .htaccess File (Apache)

If resetting permalinks doesn’t fix the issue, verify your .htaccess file contains the correct WordPress rewrite rules.

# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress

Make sure the file is located in your WordPress root directory and is writable by the server.

3. Configure Nginx Rewrite Rules

If you use Nginx, WordPress permalinks require specific rewrite rules in your server configuration. Add or verify the following inside your server block:

location / {
    try_files $uri $uri/ /index.php?$args;
}

After updating Nginx config, reload Nginx:

sudo nginx -s reload

4. Check File Permissions

Ensure .htaccess (Apache) or your WordPress root directory files have correct permissions:

chmod 644 .htaccess
chmod 755 /path/to/wordpress/

Incorrect permissions can prevent WordPress from updating rewrite rules.

5. Disable Plugins Temporarily

Some plugins interfere with rewrite rules. Temporarily deactivate all plugins to check if the issue resolves:

wp plugin deactivate --all

If posts work after deactivation, reactivate plugins one by one to identify the culprit.

Works on

Environment Notes
Apache Requires correct .htaccess with WordPress rewrite rules.
Nginx Needs proper try_files directive in server block.
LiteSpeed Compatible with Apache-style .htaccess rules.
cPanel / Plesk Standard hosting control panels; ensure file permissions and rewrite modules enabled.

FAQ

Q: Why do pages work but posts return 404 errors?
A: Pages often use static URLs that don’t rely on rewrite rules as heavily as posts. If rewrite rules are broken, posts URLs break but pages can still load.
Q: Can a plugin cause posts to 404?
A: Yes, plugins that modify URLs or rewrite rules can cause conflicts leading to 404 errors on posts.
Q: How do I flush rewrite rules manually?
A: Besides saving permalinks in the dashboard, you can add flush_rewrite_rules(); in your theme’s functions.php temporarily and then remove it after the rules flush.
Q: What if I don’t have access to .htaccess or Nginx config?
A: Contact your hosting provider to ensure rewrite modules are enabled and configurations are correct.
Q: Does changing permalink structure fix the issue?
A: Sometimes changing and saving a different permalink structure forces rewrite rules to update and resolves 404 errors.
…
Fixes & Errors

Fix “Sorry, this file type is not permitted for security reasons”

Posted on August 19, 2025 By Admin No Comments on Fix “Sorry, this file type is not permitted for security reasons”

Fix “Sorry, this file type is not permitted for security reasons”

If you’ve ever tried uploading a file to WordPress and encountered the error message “Sorry, this file type is not permitted for security reasons”, you know how frustrating it can be. This error prevents you from uploading certain file types that WordPress does not allow by default. The quick fix is to enable support for those file types safely by adding a small snippet of code to your theme or a custom plugin.

Quick Fix

  1. Access your WordPress site files via FTP or your hosting file manager.
  2. Open your active theme’s functions.php file or create a site-specific plugin.
  3. Copy and paste the following code to allow additional file types (example allows SVG and JSON):
function custom_mime_types($mimes) {
    $mimes['svg'] = 'image/svg+xml';
    $mimes['json'] = 'application/json';
    return $mimes;
}
add_filter('upload_mimes', 'custom_mime_types');
  1. Save the file and try uploading your file again.

Why This Happens

WordPress restricts file uploads to a predefined list of MIME types for security reasons. This prevents potentially harmful files from being uploaded and executed on your server. When you try to upload a file type not on this list, WordPress blocks it and shows the error message.

Commonly blocked file types include SVG, JSON, and some custom file formats. While these files can be safe, WordPress errs on the side of caution. To allow these files, you need to explicitly add their MIME types to the allowed list.

Step-by-step: Fixing on Different Environments

1. Using functions.php (Works on all setups)

  1. Log in to your hosting control panel or use an FTP client.
  2. Navigate to /wp-content/themes/your-active-theme/.
  3. Open functions.php in a text editor.
  4. Add the following code at the end of the file:
function custom_mime_types($mimes) {
    $mimes['svg'] = 'image/svg+xml';
    $mimes['json'] = 'application/json';
    return $mimes;
}
add_filter('upload_mimes', 'custom_mime_types');
  1. Save and upload the file back to the server.
  2. Test uploading your file again.

2. Using a Site-Specific Plugin (Recommended for theme-independent fix)

  1. Create a new file named custom-mime-types.php on your local machine.
  2. Paste the following code inside:
<?php
/*
Plugin Name: Custom MIME Types
Description: Allow additional file types for upload.
Version: 1.0
Author: Your Name
*/

function custom_mime_types($mimes) {
    $mimes['svg'] = 'image/svg+xml';
    $mimes['json'] = 'application/json';
    return $mimes;
}
add_filter('upload_mimes', 'custom_mime_types');
  1. Save and upload this file to /wp-content/plugins/ via FTP or file manager.
  2. Go to WordPress admin > Plugins and activate Custom MIME Types.
  3. Try uploading your file again.

3. Nginx Configuration (Optional)

If you are using Nginx and still face issues after allowing MIME types in WordPress, you may need to add MIME types in your Nginx config:

http {
    ...
    types {
        image/svg+xml svg;
        application/json json;
        # other MIME types
    }
    ...
}

After editing, reload Nginx:

sudo nginx -s reload

4. Apache Configuration (Optional)

For Apache servers, ensure the MIME types are recognized by adding them to your .htaccess or Apache config:

AddType image/svg+xml svg
AddType application/json json

Restart Apache if you edited the main config:

sudo systemctl restart apache2

5. cPanel / Plesk Users

Both cPanel and Plesk allow you to edit MIME types via their control panels:

  • cPanel: Go to Advanced > MIME Types and add the new types.
  • Plesk: Navigate to Tools & Settings > MIME Types and add the required types.

After adding, retry your upload.

Works on

  • WordPress on Apache, Nginx, LiteSpeed servers
  • Hosting control panels: cPanel, Plesk, DirectAdmin
  • Any WordPress theme or custom plugin setup
  • Local development environments like LocalWP, XAMPP, MAMP

FAQ

Q: Is it safe to allow SVG uploads in WordPress?
A: SVG files can contain malicious code if not sanitized. Use a plugin like “Safe SVG” or sanitize SVG files before uploading.
Q: Can I allow all file types by disabling this check?
A: It’s not recommended as it poses a security risk. Always whitelist only the file types you need.
Q: Why do I still get the error after adding MIME types?
Check your server’s MIME type configuration (Nginx/Apache) and ensure caching or security plugins are not blocking uploads.
Q: Can I add MIME types via a plugin instead of code?
Yes. Plugins like “WP Add Mime Types” allow you to add MIME types via the admin interface without coding.
Q: Does this fix work for multisite WordPress installations?
Yes, but you may need to add the code in the main site’s functions.php or a network-activated plugin.
…
Fixes & Errors

Fix “Destination folder already exists” when installing plugins/themes

Posted on August 19, 2025 By Admin No Comments on Fix “Destination folder already exists” when installing plugins/themes

Fix “Destination folder already exists” when installing plugins/themes

If you’ve ever tried to install a plugin or theme in WordPress and encountered the error “Destination folder already exists”, you know it can be frustrating. This error prevents WordPress from unpacking and installing the new plugin or theme because a folder with the same name already exists on your server. The quick fix is to delete or rename the existing folder before retrying the installation.

Quick Fix

  1. Access your website’s files via FTP, SFTP, or your hosting control panel’s file manager.
  2. Navigate to wp-content/plugins for plugins or wp-content/themes for themes.
  3. Locate the folder named exactly as the plugin or theme you are trying to install.
  4. Delete or rename this folder (e.g., add -old to the folder name).
  5. Return to your WordPress dashboard and retry the plugin or theme installation.

Why this happens

WordPress installs plugins and themes by unpacking a ZIP archive into a folder inside wp-content/plugins or wp-content/themes. If a folder with the same name already exists, WordPress cannot overwrite it and throws the “Destination folder already exists” error.

This can happen if:

  • A previous installation or update failed and left files behind.
  • You manually uploaded the plugin or theme folder before.
  • A plugin or theme folder was not properly deleted.
  • File permissions or ownership issues prevent WordPress from removing the folder.

Step-by-step: Fix on Nginx/Apache with cPanel/Plesk

1. Access your server files

Use one of the following methods to access your WordPress files:

  • FTP/SFTP: Connect with an FTP client like FileZilla using your hosting credentials.
  • cPanel File Manager: Log in to cPanel, go to File Manager.
  • Plesk File Manager: Log in to Plesk, navigate to Files.

2. Navigate to the plugin or theme folder

cd public_html/wp-content/plugins
# or for themes
cd public_html/wp-content/themes

3. Identify the conflicting folder

Look for the folder with the same name as the plugin or theme you want to install. For example, if installing “my-plugin”, look for a folder named my-plugin.

4. Delete or rename the folder

To delete the folder via command line (if you have SSH access):

rm -rf my-plugin

If you use cPanel or Plesk File Manager, right-click the folder and select Delete or rename it to my-plugin-old.

5. Check file permissions (optional)

Ensure WordPress can write to the plugins/themes folder:

chmod 755 wp-content/plugins
chmod 755 wp-content/themes

If ownership is an issue, contact your hosting provider or set ownership to the web server user (e.g., www-data on Ubuntu):

chown -R www-data:www-data wp-content/plugins
chown -R www-data:www-data wp-content/themes

6. Retry plugin/theme installation

Go back to your WordPress dashboard and install the plugin or theme again. The error should no longer appear.

Works on

Server Control Panel Notes
Apache cPanel, Plesk Standard file permissions and ownership apply.
Nginx cPanel, Plesk Same fix applies; ensure correct user ownership.
LiteSpeed cPanel, Plesk Compatible with same file management steps.

FAQ

Q1: Can I just overwrite the existing folder instead of deleting it?
A1: WordPress does not overwrite existing folders during installation. You must delete or rename the folder first to avoid conflicts.
Q2: What if I don’t have FTP or file manager access?
A2: Contact your hosting provider’s support to assist with deleting or renaming the conflicting folder.
Q3: Could this error be caused by file permission issues?
A3: Yes. If WordPress cannot delete or overwrite folders due to permission problems, you may see this error. Fix permissions or ownership as shown above.
Q4: Is it safe to delete the existing plugin or theme folder?
A4: Only delete if you are sure the folder is from a failed or old installation. Back up your site if unsure.
Q5: How can I avoid this error in the future?
A5: Always delete plugins or themes from the WordPress dashboard instead of manually removing files. Ensure updates complete successfully.
…
Fixes & Errors

Fix WordPress login loop (keeps redirecting to login)

Posted on August 19, 2025 By Admin No Comments on Fix WordPress login loop (keeps redirecting to login)

Fix WordPress login loop (keeps redirecting to login)

If you are trying to log into your WordPress admin dashboard but keep getting redirected back to the login page, you are stuck in a frustrating login loop. This issue, commonly known as the WordPress login loop keeps redirecting, prevents access to your site’s backend and can disrupt your workflow. Fortunately, there are straightforward fixes to resolve this problem quickly.

This article explains why the login loop happens and provides a quick copy/paste fix. It also walks you through detailed steps for different server environments like Nginx, Apache, cPanel, and Plesk.

Quick Fix

  1. Clear your browser cookies and cache for your site.
  2. Check and reset your WordPress site URL and home URL in wp-config.php:
define('WP_HOME','https://yourdomain.com');
define('WP_SITEURL','https://yourdomain.com');
  1. Disable all plugins by renaming the wp-content/plugins folder via FTP or file manager.
  2. Switch to a default theme by renaming your active theme folder in wp-content/themes.
  3. Ensure your .htaccess file (Apache) or Nginx config is correct and not causing redirects.
  4. Check your server’s PHP session and cookie settings.

Why this happens

The WordPress login loop usually occurs due to one or more of the following reasons:

  • Incorrect site URL settings: If the WordPress Address (URL) and Site Address (URL) do not match or are misconfigured, WordPress redirects you back to login.
  • Corrupted or conflicting plugins/themes: Plugins or themes that interfere with authentication or cookies can cause the loop.
  • Browser cookies or cache issues: Old or corrupted cookies can prevent proper login sessions.
  • Server misconfiguration: Incorrect rewrite rules in .htaccess or Nginx config files, or PHP session problems, can break login flow.
  • HTTPS and SSL issues: Mixed content or forced HTTPS redirects without proper configuration can cause redirect loops.

Step-by-step

1. Clear Browser Cookies and Cache

Before making server changes, clear your browser’s cookies and cache for your site domain to eliminate stale session data.

2. Set Correct Site URL in wp-config.php

  1. Access your site files via FTP, SFTP, or your hosting file manager.
  2. Open wp-config.php in the root WordPress directory.
  3. Add these lines just above the line that says /* That's all, stop editing! Happy blogging. */:
define('WP_HOME','https://yourdomain.com');
define('WP_SITEURL','https://yourdomain.com');

Replace https://yourdomain.com with your actual site URL including https if SSL is enabled.

3. Disable All Plugins

  1. Rename the wp-content/plugins folder to plugins-disabled via FTP or file manager.
  2. Try logging in again. If successful, a plugin is causing the issue.
  3. Rename the folder back to plugins and reactivate plugins one by one to find the culprit.

4. Switch to a Default Theme

  1. Rename your active theme folder in wp-content/themes (e.g., twentytwentyone to twentytwentyone-disabled).
  2. WordPress will fallback to a default theme like Twenty Twenty-One.
  3. Try logging in again.

5. Check and Reset .htaccess (Apache)

  1. Backup and delete your current .htaccess file in the WordPress root directory.
  2. Create a new .htaccess file with the default WordPress rules:
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress
  1. Save and test login again.

6. Check Nginx Configuration

Ensure your Nginx config includes the correct rewrite rules for WordPress. A typical configuration looks like this:

location / {
    try_files $uri $uri/ /index.php?$args;
}

If you have forced HTTPS or redirects, verify they do not conflict with login URLs.

7. Verify PHP Session and Cookie Settings

  • Make sure PHP sessions are enabled and writable on your server.
  • Check php.ini for proper session.save_path and cookie parameters.
  • Confirm your site uses consistent HTTP or HTTPS URLs to avoid cookie mismatches.

Works on

Server Control Panel Web Server
Shared Hosting, VPS, Dedicated cPanel, Plesk, DirectAdmin Apache, Nginx, LiteSpeed

This guide applies to most typical WordPress hosting environments including Apache and Nginx servers managed via cPanel or Plesk.

FAQ

Q1: Why does clearing cookies fix the login loop?
Cookies store your login session data. If they become corrupted or outdated, WordPress cannot validate your login, causing a redirect loop. Clearing cookies resets this data.
Q2: Can a plugin cause the login loop?
Yes. Plugins that handle authentication, security, or redirects can interfere with login sessions. Disabling all plugins helps identify if one is responsible
…
Fixes & Errors

Increase WordPress PHP memory limit (Allowed memory size exhausted)

Posted on August 19, 2025 By Admin No Comments on Increase WordPress PHP memory limit (Allowed memory size exhausted)

Increase WordPress PHP Memory Limit (Allowed memory size exhausted)

If you encounter the “Allowed memory size exhausted” error in WordPress, it means your site has reached the maximum PHP memory allocated by your server. This limits WordPress from executing scripts properly, causing errors or white screens. The quick fix is to increase the PHP memory limit to allow WordPress more resources to run smoothly.

Quick Fix

  1. Edit your wp-config.php file located in your WordPress root directory.
  2. Add or update the following line just before the /* That's all, stop editing! Happy blogging. */ comment:
define('WP_MEMORY_LIMIT', '256M');

This increases the PHP memory limit to 256 megabytes, which is sufficient for most sites.

Why This Happens

WordPress runs on PHP, which has a memory limit set by your server’s PHP configuration. When a script exceeds this limit, PHP throws the “Allowed memory size exhausted” fatal error. Common causes include:

  • Heavy plugins or themes consuming excessive memory.
  • Large imports, backups, or media processing tasks.
  • Default PHP memory limit set too low (often 32M or 64M).
  • Shared hosting environments with strict memory caps.

Increasing the memory limit gives WordPress more room to operate, preventing these errors.

Step-by-step: Increase PHP Memory Limit

1. Using wp-config.php (Recommended)

  1. Access your WordPress root directory via FTP, SFTP, or your hosting file manager.
  2. Open the wp-config.php file for editing.
  3. Locate the line that says /* That's all, stop editing! Happy blogging. */.
  4. Add this line right above it:
define('WP_MEMORY_LIMIT', '256M');

Save and upload the file back to the server.

2. Editing php.ini (If you have server access)

  1. Locate your php.ini file (usually in /etc/php/ or your hosting control panel).
  2. Open php.ini for editing.
  3. Find the line starting with memory_limit.
  4. Change it to:
memory_limit = 256M
  1. Save the file and restart your web server (Apache/Nginx) to apply changes.

3. Using .htaccess (Apache only)

  1. Open the .htaccess file in your WordPress root directory.
  2. Add this line at the top:
php_value memory_limit 256M

Note: This method only works if your hosting allows overriding PHP settings via .htaccess.

4. cPanel/Plesk PHP Memory Limit Adjustment

  1. Log in to your hosting control panel (cPanel or Plesk).
  2. Navigate to PHP Settings or PHP Selector.
  3. Find the memory_limit setting and increase it to 256M or higher.
  4. Save changes and restart PHP if required.

Works on

Environment Compatibility
Apache Web Server Yes (via wp-config.php, php.ini, .htaccess)
Nginx Web Server Yes (via wp-config.php, php.ini)
LiteSpeed Web Server Yes (via wp-config.php, php.ini)
cPanel Hosting Yes (via PHP Selector or php.ini)
Plesk Hosting Yes (via PHP Settings or php.ini)

FAQ

Q1: How much memory should I set for WordPress PHP memory limit?
A: 256M is a good starting point for most sites. For very large or resource-heavy sites, you may increase it to 512M or more, but check with your hosting provider first.
Q2: What if increasing memory limit doesn’t fix the error?
A: The error might be caused by poorly coded plugins or themes consuming excessive memory. Try disabling plugins one by one or switching to a default theme to identify the culprit.
Q3: Can I increase memory limit via WordPress dashboard?
A: No, WordPress dashboard does not provide an option to increase PHP memory. You must edit server or WordPress configuration files.
Q4: Is there a risk in increasing PHP memory limit?
A: Increasing memory limit allows scripts to use more server resources, which can impact server performance if set too high. Always increase cautiously and monitor your site’s behavior.
Q5: My hosting provider doesn’t allow increasing memory limit. What can I do?
A: Contact your hosting support to request a higher memory limit or consider upgrading to a hosting plan with more resources.
…
Fixes & Errors

Fix “Sorry, you are not allowed to access this page”

Posted on August 19, 2025 By Admin No Comments on Fix “Sorry, you are not allowed to access this page”

Fix “Sorry, you are not allowed to access this page” in WordPress

If you see the message “Sorry, you are not allowed to access this page” when trying to access your WordPress admin dashboard or certain pages, it usually means your user permissions or site configuration are misconfigured. This error can block you from managing your site, but the fix is often straightforward.

Quick fix: Reset your user roles and capabilities or fix your site’s .htaccess or Nginx config to restore proper access.

Quick Fix

  1. Access your WordPress database via phpMyAdmin or a database client.
  2. Run this SQL query to reset your admin user capabilities (replace 1 with your user ID if different):
DELETE FROM wp_usermeta WHERE user_id = 1 AND meta_key = 'wp_capabilities';
INSERT INTO wp_usermeta (user_id, meta_key, meta_value) VALUES (1, 'wp_capabilities', 'a:1:{s:13:"administrator";b:1;}');
  1. Check your .htaccess (Apache) or Nginx config for incorrect rules blocking access.
  2. Clear your browser cache and cookies, then log in again.

Why This Happens

  • Corrupted user roles or capabilities: Plugins or manual changes can accidentally remove or alter administrator capabilities, causing WordPress to block access.
  • Incorrect file permissions or ownership: Server permissions that restrict access to key WordPress files can trigger this error.
  • Misconfigured .htaccess or Nginx rules: Security rules or redirects may unintentionally block admin pages.
  • Plugin or theme conflicts: Faulty or incompatible plugins/themes can interfere with user permissions.
  • Database issues: Corrupted or missing database entries related to user roles.

Step-by-step Fix

1. Reset Administrator Capabilities via Database

Use phpMyAdmin or your preferred database tool to run these commands. Replace wp_ with your database prefix if different, and 1 with your admin user ID if needed.

DELETE FROM wp_usermeta WHERE user_id = 1 AND meta_key = 'wp_capabilities';

INSERT INTO wp_usermeta (user_id, meta_key, meta_value) VALUES (1, 'wp_capabilities', 'a:1:{s:13:"administrator";b:1;}');

This removes any corrupted capabilities and restores administrator rights.

2. Check and Fix File Permissions

Connect to your server via SSH or FTP and run these commands to set correct permissions:

find /path/to/wordpress/ -type d -exec chmod 755 {} ;
find /path/to/wordpress/ -type f -exec chmod 644 {} ;

Replace /path/to/wordpress/ with your actual WordPress root directory.

3. Verify .htaccess (Apache) or Nginx Configuration

For Apache: Check your .htaccess file in the WordPress root. It should contain the standard WordPress rules:

# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress

If you have custom rules blocking access, comment them out or remove them temporarily.

For Nginx: Check your site configuration file, usually located in /etc/nginx/sites-available/. Ensure your location blocks allow access to /wp-admin and /wp-login.php. A minimal working example:

location /wp-admin/ {
    try_files $uri $uri/ /index.php?$args;
}

location = /wp-login.php {
    include fastcgi_params;
    fastcgi_pass unix:/var/run/php/php7.4-fpm.sock; # adjust PHP version/socket
    fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
}

Reload Nginx after changes:

sudo nginx -t
sudo systemctl reload nginx

4. Disable All Plugins Temporarily

If the problem persists, disable plugins by renaming the plugins folder via FTP or SSH:

mv /path/to/wordpress/wp-content/plugins /path/to/wordpress/wp-content/plugins-disabled

Try accessing the admin again. If successful, rename the folder back and reactivate plugins one by one to find the culprit.

5. Switch to Default Theme

Rename your active theme folder to force WordPress to use a default theme like Twenty Twenty-One:

mv /path/to/wordpress/wp-content/themes/your-active-theme /path/to/wordpress/wp-content/themes/your-active-theme-disabled

Check if access is restored.

Works on

Environment Notes
Apache Fixes .htaccess and permissions issues
Nginx Fixes server config for admin access
cPanel Access phpMyAdmin, file manager, and terminal for fixes
Plesk Use database manager and file manager for troubleshooting
LiteSpeed Similar to Apache, check .htaccess and permissions

FAQ

Q1: I can’t access phpMyAdmin. How else can I reset user capabilities?

If you have SSH access, you can use WP-CLI commands:

wp user set-role 1 administrator

This sets user ID 1 to administrator.

Q2: Could a plugin cause this error?

Yes. Plugins that modify user roles or security plugins can cause permission issues. Disable plugins temporarily to test.

Q3: What if I still can’t access wp-admin

…
Fixes & Errors

Fix “Briefly unavailable for scheduled maintenance” in WordPress

Posted on August 19, 2025 By Admin No Comments on Fix “Briefly unavailable for scheduled maintenance” in WordPress

Fix “Briefly unavailable for scheduled maintenance” in WordPress

If you’ve ever updated a WordPress plugin, theme, or core and seen the message “Briefly unavailable for scheduled maintenance. Check back in a minute.” stuck on your site, you’re not alone. This message appears when WordPress is in maintenance mode during updates, but sometimes it doesn’t disappear automatically. The quick fix is to manually delete the .maintenance file from your WordPress root directory.

Quick Fix

  1. Access your website files via FTP, SFTP, or your hosting file manager.
  2. Locate the .maintenance file in the root folder of your WordPress installation.
  3. Delete the .maintenance file.
  4. Reload your website to confirm it’s back online.

Why This Happens

When WordPress performs updates, it creates a temporary .maintenance file in the root directory to put the site into maintenance mode. This prevents visitors from seeing broken or incomplete pages during the update process.

Normally, WordPress deletes this file automatically once the update finishes. However, if the update is interrupted — due to server timeout, connection issues, or plugin conflicts — the .maintenance file remains, causing the site to stay stuck in maintenance mode.

Step-by-step: Fixing the Issue

For Nginx or Apache Servers

  1. Connect to your server using an FTP client like FileZilla or via SSH.
  2. Navigate to your WordPress root directory (where wp-config.php is located).
  3. Look for the .maintenance file. It may be hidden, so ensure your FTP client shows hidden files.
  4. Delete the .maintenance file.
  5. Clear your browser cache and reload your website.
# Example SSH commands:
cd /path/to/wordpress
rm .maintenance

For cPanel or Plesk Users

  1. Log in to your hosting control panel (cPanel or Plesk).
  2. Open the File Manager.
  3. Navigate to your WordPress root directory (usually public_html or a subfolder).
  4. Enable “Show Hidden Files” if not already enabled.
  5. Find and delete the .maintenance file.
  6. Reload your website to verify the fix.

Works on

  • Web servers: Nginx, Apache, LiteSpeed
  • Hosting control panels: cPanel, Plesk, DirectAdmin
  • File access methods: FTP, SFTP, SSH, Hosting File Managers
  • WordPress versions: All versions that use the maintenance mode file during updates

FAQ

Q: What if I don’t see the .maintenance file?
A: Make sure your FTP client or file manager shows hidden files. The .maintenance file is hidden by default because of the leading dot.
Q: Can I just wait for the maintenance mode to end?
A: Usually yes, but if the update process was interrupted, the site will stay stuck. Manual removal of the .maintenance file is needed.
Q: Will deleting the .maintenance file cause any data loss?
A: No, deleting this file only ends maintenance mode. It does not affect your database or content.
Q: How can I prevent this from happening again?
A: Ensure your server has enough resources and stable connections during updates. Avoid interrupting updates manually and keep plugins/themes compatible and updated.
Q: Is there a plugin to fix this automatically?
A: Some plugins can detect and remove the maintenance file, but manual removal is the most reliable and fastest method.
…
Fixes & Errors

Posts pagination

1 2 Next

Recent Posts

  • Top WordPress Themes for Blogs in 2025
  • WordPress Admin Panel Trick: Adding ID Field to the Posts Listing
  • Solution previous_posts_link and next_posts_link Not Working
  • Show Top Commentators in WordPress Without a Plugin
  • How to Style Admin Comments in WordPress

Recent Comments

    Archives

    • August 2025

    Categories

    • Admin & Blocks
    • Admin & UI
    • Automation
    • Automation & Plugins
    • Comments
    • Comparisons
    • Database & Revisions
    • Developer Snippets
    • Fixes & Errors
    • Media & Thumbnails
    • Queries & Pagination
    • Security
    • Speed & Security
    • Tips & Tricks
    • WooCommerce How‑tos
    • WordPress Snippets
    • WordPress Themes
    • Terms & Conditions
    • Affiliate Disclosure

    Copyright © 2025 wpcanyon.com.

    Powered by PressBook WordPress theme