0

My site is pretty slow , so I am looking to update the wordpress in hopes of getting it back on track. What are best practices?

because ,

getting few PHP notice & warnings in the Debug log. + The HTML takes too long too load.

mysqld.bin takes 97-99 % cpu ... any help would highly appreciated.

Let me know if any more information is required.

2
  • 1
    The "best practice", is the usual: make a backup, then upgrade and test everything. Not sure why you think this case is special?
    – fuxia
    Commented Oct 2, 2020 at 9:50
  • Apparently the site is working fine , but suddenly server is not responding & giving request_timed_out error. So just to see if it is WP related , I am doing it. I don't want to mess anything in perfectly working website. & yes , doing this for the first time. that's y. Commented Oct 2, 2020 at 11:13

1 Answer 1

2

You have two tasks to solve here: 1. Resolve the time-out problem. 2. Update WordPress.

Resolve the time-out problem

These things don't just happen because your WP is old. There must be a concrete reason.

The three most common reasons are:

  1. Not enough memory. Maybe your hosting provider has limited the memory? Try adding the following line in your wp-config.php above the "Happy blogging" line:

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

    If that doesn't help, ask your provider.

  2. A very large option is stored in your database and fetched on every request. Go to your database management tool, like phpMyAdmin, and sort the wp_options table (assuming your table prefix is wp_ by the size of the value column. If there is any very large option, consider deleting it. But make a database backup first!

  3. Some plugin is making a request to an external source, overriding WordPress’ pre-set time-out, and the remote site doesn't respond in time. Disable all plugins, and see if that helps. Then re-enable them one after another, until the issue reappears. Deactivate that plugin, and try to find an alternative.

Update WordPress

  1. Make a backup of your database.
  2. Make a backup of your uploads. They shouldn't be affected by the update, but it's always nice to have that backup.
  3. If you are using a default theme (named Twenty-X) and made changes to it — which you absolutely shouldn't — back up that theme too.
  4. Disable all plugins, and switch to a default theme.
  5. Update WordPress.
  6. Re-enable the theme and the plugins, again one by one, check that everything is working as expected. If it doesn't, you might need your backups to roll everything back, but that's not very likely.
  7. Update your plugins.

That's it.

There are tools like Deployer that can help automate this process, and they make it easy to roll back a broken update within seconds to the last working state. You might want to learn using such a tool.

14
  • Tried the first one & no help. Will try to figure out rest of the options. Commented Oct 2, 2020 at 12:22
  • Thanks, fuxia. wp_options is showing size=547.5Mib & Total size of all tables is =630.9 Mib ..... is that normal ? Commented Oct 2, 2020 at 13:16
  • @DhavalJoshi No, that's quite a lot. Try to find the largest values.
    – fuxia
    Commented Oct 2, 2020 at 13:51
  • I tried the wp optimize plugin & used to delete the transients.There are 839 post revisions. is it safe to delete? Commented Oct 2, 2020 at 14:14
  • @DhavalJoshi If you are sure you don't need the revisions, you can delete them. But they are not part of your current problem. Solve the actual issues first. :)
    – fuxia
    Commented Oct 2, 2020 at 15:17

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.