One place for hosting & domains

      How To Fix the WordPress Memory Exhausted Error by Increasing Your Site’s PHP Memory Limit

      As you may know, WordPress is built using PHP. This programming language is incredibly flexible, but it also has a few drawbacks. For example, if you don’t allocate enough memory for your WordPress installation, you might start running into the occasional “PHP Memory Exhausted” error.

      In a nutshell, this error means your server isn’t allocating enough resources for WordPress to execute the PHP scripts it needs to function properly. This issue can negatively affect your site’s functionality, but there are several ways you can fix and even prevent it.

      In this article, we’ll show you how to fix the memory exhausted problem by increasing your PHP memory limit. However, first, let’s talk about how to recognize this error and what it means!

      Why You’re Seeing a WordPress Memory Limit Error on Your Site

      As we mentioned earlier, the PHP memory limit error means you’re not allocating enough resources for your WordPress installation to function correctly. The problem usually presents itself with a message such as:

      The memory exhausted PHP fatal error.

      Don’t be scared by the word “fatal,” though. Your website isn’t broken, but you will need to make some changes to your WordPress installation if you want it to work properly. Specifically, you’ll want to increase your PHP memory limit.

      By “PHP memory limit,” we mean the amount of server memory that’s allocated to run PHP scripts. By default, that number should be around 64 MB or higher. In most cases, 64 MB is more than enough, however.

      Most hosting servers provide you with far more memory than that, so increasing the PHP allowed memory size shouldn’t negatively impact your website’s performance whatsoever. In fact, unless you’re using a cheap web host or you set up WordPress manually, your PHP memory limit shouldn’t be an issue at all.

      You can easily check to see what your PHP memory limit is by accessing your WordPress dashboard and navigating to Tools > Site Health > Info. Next, you can click on the Server tab and look for the PHP memory limit entry.

      A website with a high PHP memory size.

      Within the Server tab, you can also check other information such as your PHP version and the PHP time limit. The latter variable, which is in seconds, defines how long PHP scripts have to execute before they time out.

      For now, let’s focus on the PHP memory limit. As you can see, the above example has quite a high limit, which means that the website is unlikely to run into a WordPress Memory Exhausted error.

      If your site has a low memory limit (<64 MB), it’s in your best interests to increase it. There are a couple of ways you can do so.

      Take Your WordPress Website to the Next Level

      Whether you need help navigating your web hosting control panel, fixing an error, or finding the right plugin, we can help! Subscribe to our monthly digest so you never miss an article.

      How to Resolve the WordPress Memory Limit Error (2 Methods)

      As far as WordPress errors go, this one has a clear-cut cause and solution. You’re not allocating enough memory for your PHP installation, so you need to increase that number. In this section, we’ll go over two methods you can use: one manual technique and one that requires your wallet.

      1. Increase the PHP Memory Allocated to Your Website Manually

      WordPress enables you to declare your allowed memory size manually by modifying one of two files: .htaccess and wp-config.php. However, changing your WordPress installation’s .htaccess file can lead to site-wide errors since that file governs how it interacts with your server.

      Increasing your PHP memory limit through wp-config.php is, in most cases, the safest option, and it’s remarkably easy to do. All you need is a Secure File Transfer Protocol (SFTP) client such as FileZilla that you can use to connect to your website.

      Once you access your website via SFTP, open the WordPress root folder and look for the wp-config.php file within it.

      A WordPress wp-config.php file.

      Open that file using a text editor, and you should see something like this:

      Editing a wp-config.php file.

      To increase your PHP memory limit, you can simply add a single line of code anywhere after the <?php tag and before the part of the file that reads “/* That’s all, stop editing! Happy blogging. */”.

      This is the line of code to add:

      define( 'WP_MEMORY_LIMIT', 'XXXM' );

      You’ll need to replace the “XXX” variable within that line with the amount of memory you want to allocate to PHP. As we mentioned before, the absolute minimum you should settle for is 64 MB.

      However, you can also double the number to play it safe or increase it even further. For example, if you set a PHP memory limit of 256 MB, it would look like this:

      define( 'WP_MEMORY_LIMIT', ‘256M’);

      Once you’re set on a number, save the changes to wp-config.php and close the editor. Now return to your WordPress dashboard and navigate to Tools > Site Health > Info > Server to see if the changes went through.

      In some cases, declaring your PHP memory limit manually won’t work because you don’t have the necessary permissions to change that value. If you can’t adjust your WordPress memory size manually, that leaves you with one other option.

      2. Upgrade Your Website’s Hosting Plan

      Typically, if you use a decent WordPress hosting provider, you won’t need to worry about increasing your PHP memory limit. One caveat is that if you’re using shared hosting, you’ll likely face limited resources. So if you’re encountering this error, it might be time to upgrade to a better hosting plan.

      Upgrading your hosting package will usually result in an increase in available PHP memory. That means you’re much less likely to run into a WordPress memory limit error. The only limiting factor is your budget.

      If you can’t upgrade hosting plans right now, it might be worth contacting your provider’s support team and seeing if they can increase your PHP memory limit on their end. If they can’t, it might be time to switch to a better WordPress host that offers high PHP memory limits on affordable plans.

      Skip the Stress

      Avoid troubleshooting when you sign up for DreamPress. Our friendly WordPress experts are available 24/7 to help solve website problems — big or small.

      Want More WordPress Error Tips?

      Once you increase PHP memory on your WordPress website, we can help tackle other issues. We’ve put together several tutorials to help you troubleshoot every error message:

      Want more information on WordPress site management? Check out our WordPress Tutorials, a collection of guides designed to help you navigate the WordPress dashboard like an expert.

      Increasing PHP Memory Limit

      Running into a PHP fatal error can be worrying, but it’s not necessarily a cause for concern. Learning how to increase your PHP memory limit is relatively simple if you don’t mind using an SFTP client and adding a single line of code to one of WordPress’ core files.

      The alternative is to upgrade your hosting plan or opt for a better provider. Most WordPress-friendly hosting options offer high limits by default, so you’ll never run into a PHP memory exhausted error ever again.

      If you’re ready to use a web host optimized for WordPress websites, check out our DreamPress hosting packages! We offer optimized WordPress setups, so you spend less time troubleshooting errors and more time working on your website.

      Source link

      How to Fix the Sidebar Below Content Error in WordPress (In 3 Steps)

      Perfecting your WordPress website’s layout can be a lot of work, but it’s also essential for User Experience (UX), engagement, and conversions. Therefore, it can be frustrating when a seemingly random error causes a disruption to your site’s display — such as your sidebar suddenly appearing below the content rather than to the side.

      While there are a few potential causes, it primarily comes down to issues with the Hypertext Markup Language (HTML) or Cascading Style Sheets (CSS). Fortunately, the issues are relatively easy to fix, so you can quickly get your site back in tip-top shape.

      In this article, we’ll walk through the common causes of this error, then show you how to resolve it in three simple steps. Let’s get started!

      Common Causes of the Sidebar Dropping Below the Content in WordPress

      Sidebars in WordPress are content areas meant to be displayed either to the left or right of the page’s main segment (or sometimes both). They often contain widgets, sign-up forms, links to related posts, or similar content that you’d want to include across your site.

      Due to various bugs or errors, your sidebars may sometimes appear at the bottom of the page, rather than to the left or right. Needless to say, this can easily ruin a well-designed website.

      The primary cause of this behavior is problems with either the HTML or CSS on your site. It is usually a result of direct changes you’ve made to your site’s code, such as a theme or plugin file.

      For example, perhaps there is an extra or undisclosed <div> tag on the page. The problem could even be attributed to incorrect width and floating settings in your CSS. Fortunately, fixing this error is easy enough.

      Skip the Stress

      Avoid troubleshooting when you sign up for DreamPress. Our friendly WordPress experts are available 24/7 to help solve website problems — big or small.

      How to Fix the WordPress Sidebar Below Content Error (In 3 Steps)

      Now that you know the potential causes of this perplexing error, it’s time to correct it. We recommend running through the following three steps in order, moving on to the next only if the previous one didn’t work. Before getting started, remember to make a backup of your site just in case.

      Step 1: Undo Your Most Recent Changes

      The first step is also the simplest. If your sidebar moved after making a change to your site — whether that’s installing a new plugin, adding custom code, or anything else — simply undo it. Reversing the action both gets your layout back to its original format and helps isolate the cause of the issue.

      So you can start by reversing the change and refreshing your site to see if the sidebar is back in its proper place. If so, you can then look for potential issues with whatever changes you were attempting to make. For example, if you installed a new plugin, check for alternatives. If you altered or added to your site’s code, look for any typos or syntax errors.

      Step 2: Fix Unclosed <div> Tags or Remove Extra <div> Tags

      Often, an unclosed or extra <div> tag in your site’s code is the cause of the WordPress sidebar error. These HTML tags define the boundaries of sections on your website. If they’re incorrectly placed, browsers won’t render the site properly (hence the wandering sidebar).

      Here’s an example of a correctly-formatted page:

      Correctly formatted <div> tags on a page.

      Below is the same page with an unclosed <div> tag:

      Incorrect <div> tags causing elements to appear in the wrong place.

      You can see that what should be the closing <div> tag is missing the forward slash. As a result, the browser doesn’t know that it’s meant to be closed, and the content that should be outside the element is now inside.

      To fix this, comb through any template files you’ve modified and look for missing or extra tags. Generally, these errors can be found in the “template parts” files of your WordPress theme. To get there, head to your WordPress dashboard and navigate to Appearance > Theme Editor.

      The WordPress Theme Editor.

      Choose the correct theme from the drop-down menu at the top, and then locate the template parts section in the sidebar.

      Template parts in the WordPress Theme Editor.

      The templates that generate pages and posts are usually under the content section. Find the one you need from the list, check it, and make any corrections. Then you can click on Update File to save your changes.

      If you know which file you edited, you can jump straight there. Otherwise, you’ll need to check them all for inconsistencies.

      Step 3: Correct CSS Issues

      Another frequent cause of this error is found in your site’s CSS. The WordPress Customizer’s Additional CSS section enables you to add custom CSS to your site.

      The WordPress Customizer Additional CSS section.

      If you’ve used this feature or edited the CSS through other means, you may have formatted the code incorrectly. In the case of moving sidebars, the most common culprit is the “width” property.

      You should double-check that the sum of the widths of the Content and Sidebar elements doesn’t exceed the width of the Wrap element. If it does, the smaller element will be pushed down in order to fit.

      Tools to Make Troubleshooting Sidebar Issues Easier

      You can also troubleshoot the issue yourself without using code. There are several online tools online that can validate your code and check it for errors.

      You can use the W3C Markup Validation Service to check HTML code. The W3C CSS Validation Service is the CSS counterpart. Online Web Check is also an excellent tool that works for both HTML and CSS.

      These services are also fantastic if you just want a second set of eyes on your code, regardless of skill level. A quick double-check never hurt anyone!

      You could also take fixing WordPress errors off your to-do list with our DreamCare service. Our team of experts handle everything on the backend of your site to make sure it’s safe, secure, and always up.

      Additional WordPress Resources

      Say goodbye to broken links and error messages! We’ve put together several guides to help you troubleshoot every kind of WordPress problem:

      If you’re looking for more WordPress tips and hacks, check out our WordPress Tutorials, a collection of guides that’ll help you navigate the WordPress admin area like a pro.

      Take Your WordPress Site to the Next Level

      Whether you need help choosing the right WordPress plugin, creating a child theme, or writing your first blog post, we can help! Subscribe to our monthly digest so you never miss an article.

      Solving the Sidebar Error

      If you’ve spent time building a beautiful WordPress website, you likely don’t want anything to take away from it — least of all sudden errors. Fortunately, if the problem is that your sidebars are appearing below your content, the fix is relatively simple!

      To correct the sidebar appearing below content error, you can follow these three steps:

      1. Undo any changes you made to your site just prior to the error appearing.
      2. Check for and fix unclosed or extra <div> tags in your code.
      3. Verify that your site’s CSS is correct.

      If you’d rather spend your time working on your business instead of troubleshooting your website, consider switching to DreamPress. With our managed WordPress hosting plans, we take care of the problems for you, so you can stay focused on what really matters.

      Source link

      How to Fix WordPress Error 404 Not Found

      You’ve likely seen the “Page Not Found” error before. Unfortunately, if you operate a website of any sort (WordPress or not), the day will probably come when you see the message on one of your own pages.

      Fortunately, like many common WordPress errors, 404s are relatively easy to troubleshoot and fix. The solution usually involves restoring your site’s permalink structure — something you can do in just a few minutes.

      In this article, we’ll explain just what a 404 error is and what can cause one on your site. Then we’ll walk you through how to fix it in four simple steps. Let’s get started!

      An Overview of the WordPress 404 Error

      A 404 error, also known as a “Page Not Found” error, indicates that your browser can’t locate the page you’re trying to access. The exact message can look a bit different depending on the browser you’re using, but it will generally always contain either the “404” code or a “page not found” message of some kind.

      Websites can also create their own custom 404 pages.

      A custom 404 error page.

      Seeing this notification (or any other error message) when you’re trying to access your site can be frustrating. While there is a chance that your post has actually gone missing, the vast majority of the time, there’s a more benign cause.

      Some common reasons that WordPress posts might return 404 errors include:

      • A mistyped URL. It could simply be attributed to a typo in the URL. This is the most common cause.
      • An issue with your Domain Name System (DNS) settings. If you’ve recently updated any of your DNS information and you’re seeing this error, it could be because the changes haven’t propagated fully. It can take up to 48 hours for this process to complete.
      • Problems with the permalink structure of your site. Permalink problems can be caused by a missing, broken, or corrupted .htaccess file. Compatibility issues with WordPress components such as plugins and themes could also be the culprit.

      Regardless of the cause, this error prevents access to your site, so it needs to be resolved as quickly as possible. We’ll look at troubleshooting and resolving the problem shortly.

      Skip the Stress

      Avoid troubleshooting when you sign up for DreamPress. Our friendly WordPress experts are available 24/7 to help solve website problems — big or small.

      Why 404 Errors Matter

      404 errors pose several problems for a website, beyond simply preventing you from accessing pages. First, they create a poor User Experience (UX).

      If there are many of these errors on your site, and they aren’t resolved quickly, they could eventually turn users away. In the worst-case scenario, those visitors could land on a competing website instead, costing you business.

      404 errors can also hurt your Search Engine Optimization (SEO). Search engine crawlers won’t index a page that returns a 404 because they think it doesn’t exist.

      What to Do Before Troubleshooting the WordPress 404 Error

      Before changing your permalink settings or .htaccess file, it’s a smart idea to create a backup of your website and database. This way, if you accidentally make something worse, you can easily restore your site to a functioning state.

      If your website is hosted with DreamPress, backups couldn’t be easier. DreamPress automatically backs up your entire site every day, so you always have a fresh copy to access. You can also create a manual backup with just a few clicks.

      How to Fix WordPress Posts Returning 404 Error (In 4 Steps)

      With a fresh backup of your site in hand, it’s time to get to work. You’ll want to follow these steps in order and check if the error has been resolved after each one.

      Step 1: Reset Your WordPress Permalinks

      The first step to try is resetting your permalinks. Head to your WordPress dashboard and navigate to Settings > Permalinks.

      The WordPress Permalink Settings page.

      From here, just click on Save Changes. That’s right — you don’t actually need to edit anything. Clicking that button will update the permalink settings even if you don’t make any changes. This is important because it also refreshes the rewrite rules used for “pretty permalinks.”

      With this done, go ahead and reload the pages you were trying to access. If everything works, you’re all done. If you still get a 404 error, head to the next step.

      Step 2: Restore Your .htaccess File

      If resetting your permalinks didn’t work, the next strategy is restoring your .htaccess file. This controls how WordPress interacts with the server and how it generates permalinks for your pages. Restoring it to the default settings can fix sudden 404 errors.

      To restore the .htaccess file, you’ll first need a way to access it. If you’re using DreamPress hosting, you can use the built-in file manager found in the DreamHost control panel. Most other web hosts offer a similar feature, or you can use a Secure File Transfer Protocol (SFTP) client such as FileZilla. We have detailed instructions for connecting via SFTP if you need help.

      For this example, we’ll use the DreamHost file manager. Head to your DreamHost panel and navigate to WordPress > Managed WordPress in the sidebar.

      The DreamPress domain settings page.

      Find the domain you’re having trouble with and click on the blue Manage button. On the next page, make sure the Details tab is selected at the top, and then click on Manage Files.

      The DreamHost file manager.

      This will open the file manager in a new tab. Locate and click on the folder that corresponds to your domain name. You’ll find the .htaccess file in this directory (it’s the same one that contains items such as wp-content).

      The location of the .htaccess file in the WordPress root folder.

      Next, click on the file name and select Edit from the list of options. You can copy the current contents of the file and paste them somewhere for safekeeping. For now, you’ll want to replace the contents with the following:

      # 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]
      # END WordPress

      This is the default .htaccess file for WordPress. When you’ve pasted this in, go ahead and save the file.

      Restoring this file will also reset the permalink settings for your WordPress site. Therefore, if you’re using a custom permalink structure (or have changed it at all from the default), you’ll need to restore that setting too.

      To do so, head back to your WordPress dashboard and navigate to Settings > Permalinks (just like Step 1 above). You can change it to whatever you were using before and then save it.

      Finally, refresh your website and attempt to load the pages that were returning 404 errors. If everything works now, congratulations! If not, proceed to the next step.

      Step 3: Disable All of Your WordPress Plugins and Theme

      If you’ve reset your permalinks and .htaccess file, but you’re still seeing 404 errors on your site, the next step is to check your plugins and theme. Plugins, in particular, can sometimes have bugs or compatibility issues that prevent a site from loading.

      Let’s start there. The basic idea is to disable them one by one and then check your website. If the error persists, turn it back on and move to the next one.

      To get started, head to your WordPress dashboard and navigate to Plugins > Installed Plugins.

      The ‘deactivate’ button on the WordPress plugin settings page.

      Locate and click on the Deactivate button below the first plugin. You can see that active plugins are shaded blue, while those that are off are white (as you can see with Akismet in the screenshot above). Now, refresh your site and see if the 404 error is still occurring.

      If you get the error message, head back to the plugins screen, re-activate the plugin you just tried, and move to the next one in the list. If you find one that resolves the issue, you can check for updates that may resolve the problem or find an alternative with similar functionality.

      If none of the plugins prove to be the issue, it’s time to try changing your theme. Head to Appearance > Themes.

      The WordPress theme manager.

      Your currently-active theme is marked as such. Hover over one of the others and click on Activate. Then refresh your site and try to access the problematic page again.

      Note that changing your theme can alter your site significantly. So if you find that your theme is the issue, you may need to spend some time finding one that provides a similar look and features.

      Step 4: Set Up a 301 Redirect for Moved or Renamed Content

      This one is a bit of a bonus step. If you do actually have content that’s been moved or renamed and thus doesn’t exist anymore at the URL you were using previously, you’ll want to set up some 301 redirects to point that old URL to the new one.

      The easiest way to do this is with a WordPress plugin such as Redirection.

      The Redirection WordPress plugin for managing 30 redirects.

      This tool will enable you to quickly set up the redirects you need. Plus, it’s free and user-friendly.

      How to Create Your Own “Error 404 Not Found” Page

      If you want to set up your own custom 404 error page, you can do so relatively easily. The process involves adding one line to the .htaccess file to point the error to a specific page and then creating that page. We have full instructions for setting up a custom error page to walk you through the process.

      Take Your WordPress Website to the Next Level

      Whether you need help navigating the WordPress dashboard, creating a custom 404 error page, or choosing a caching plugin, we can help! Subscribe to our monthly digest so you never miss an article.

      Tools to Help You Monitor 404 Errors Moving Forward

      Finally, if you want to keep an eye out for 404 errors in the future, you can use a few handy tools. The Google Search Console will show you crawl errors that the Google bots have come across as they index your site. This is a simple way to see all the issues Google is encountering.

      You can also enter your URL into a specialized tool such as the Broken Link Checker, which will scan your entire site for broken links and let you know if it finds a 404 page.

      The Broken Link Checker tool for finding 404 errors on your website.

      It’s free and easy to use. You can simply input your domain and then click on Check Site.

      Ready to Find That Missing WordPress Post?

      A 404 error can be frustrating — especially when it happens on your own site. These messages cause problems with SEO and ruin your site’s UX. Fortunately, they’re not too difficult to resolve.

      Fixing 404 pages generally involves restoring your site’s permalink structure and setting up redirects for any posts that are actually gone. You can then use tools such as Google Search Console to monitor your site for future 404s.

      If you want to spend less time dealing with errors, consider switching to DreamPress, our managed WordPress hosting service. We’ll take care of all the troubleshooting for you, so you can focus on what matters!

      Source link