For cloning a website locally Local WP is great. The problem is that sometimes it starts to slow down, even right from the start and on powerful machines.
And of course, when it’s slow, it gets pretty frustrating. Because, besides security, you’re supposed to be working locally to go faster, not to wait three seconds every time you open an admin page.
It was happening to me on the project for my new website, but I didn’t want to change tools. I didn’t want to set up Docker, scrap the environment, or start from scratch. I wanted Local WP to become (very) usable again.
After trying several things, these are the five steps that genuinely worked for me.
There are several other optimization options, but I stuck to these and now my local setup runs like a rocket.
Índice de Contenidos del Artículo
- 1. Confirm that Xdebug was disabled
- 2. Change the domain from .local to .test
- 3. Exclude Local WP folders from Windows Defender
- 4. Disable plugins I didn’t need locally
- 5. Clean the database from the Local shell
- Result
- Frequently asked questions
- Why is Local WP slow on Windows?
- Is it better to use .test than .local in Local WP?
- Can Xdebug slow down Local WP?
- Is it safe to exclude Local WP folders in Windows Defender?
- Which folders should I exclude from the antivirus if I use Local WP?
- Does disabling plugins improve Local WP performance?
- How can I clean the WordPress database in Local WP?
- Can I use these cleanup commands in production?
- Do I have to switch from Local WP to Docker if it is slow?
- Which tweak can improve Local WP the most on Windows?
1. Confirm that Xdebug was disabled
The first thing I checked was Xdebug.
Xdebug is used to debug PHP. If you’re going to set breakpoints, inspect variables and do serious debugging, perfect. That’s what it’s for.
But if you’re not using it, it can slow the environment down quite a bit.
In Local WP you can check it from the site panel:
Local WP > your site > Overview / Tools tab > Xdebug
In my case it was already disabled, so I didn’t have to touch anything. But from experience, it was the first suspect to rule out.
The rule is simple: if you’re not actively debugging PHP, keep Xdebug disabled.
Here it wasn’t “the solution” in my case, because it was already off, but it costs nothing to check before going crazy with other things.
2. Change the domain from .local to .test
This change was noticeable.
I had the site on a domain ending in .local (yg.local) and changed it to yg.test.
In Local WP you do it like this:
- Open Local WP.
- Select the site.
- Go to the Overview tab.
- Find the Site domain field.
- Click Change.
- Change the domain from .local to .test.
- Confirm the change.
- Restart the site.
Then, go in with the new URL:
https://yg.test
Or, if you don’t have SSL enabled in Local:
http://yg.test
Why does it work?
Because .local can cause trouble in some environments because of how it is resolved at network level. .test is much more intended for local development and avoids part of that absurd friction.
It’s a simple change that helped in my case.
3. Exclude Local WP folders from Windows Defender
Another important tweak.
If you work on Windows, Windows Defender may be constantly scanning WordPress files, plugins, themes, uploads, the database, logs, caches and Local’s internal services.
And of course, WordPress locally moves a huge number of small files. If the antivirus starts inspecting everything touched by PHP, MySQL or nginx, performance suffers.
Of course I didn’t disable the antivirus; what I did was add exclusions.
In Windows:
- Open Windows Security.
- Go to Virus & threat protection.
- Scroll down to Virus & threat protection settings.
- Click Manage settings.
- Scroll down to Exclusions.
- Click Add or remove exclusions.
- Add folder exclusions.
The important folder is the one for local sites:
C:UsersYOUR_USERLocal Sites
And also Local’s internal folders, which are usually in paths such as:
C:UsersYOUR_USERAppDataLocalProgramsLocal
And:
C:UsersYOUR_USERAppDataRoamingLocal
In my case, excluding Local Sites was especially important, because that is where the website really is: WordPress, plugins, themes, uploads and everything Local is constantly touching.
After adding the exclusions, it’s worth stopping and starting the site again from Local WP.
4. Disable plugins I didn’t need locally
The next step was pretty obvious, but sometimes we forget it or prefer not to do it so we can simulate the production environment better.
There are plugins that make external calls, scheduled tasks, security checks, backups, logs, caches, SEO analysis, newsletter integrations, monitoring, image optimization and a thousand other things.
All of that may be unnecessary locally, depending on what you’re testing.
So I reviewed the plugin list and disabled the ones I didn’t need for the work I was doing at that moment.
The question was this:
Do I need this plugin active for what I’m doing right now?
If the answer was no, I disabled it.
In my case:
- Backup plugins.
- Genesis plugins.
- Security plugins.
- Cache plugins.
- Analytics plugins.
- Plugins that launch scheduled tasks
Fewer active plugins means less load, fewer background processes and fewer things competing for resources.
Even so, I didn’t see a big improvement here, so it might be better to leave this step for the end if everything else is not enough.
5. Clean the database from the Local shell
The last step was cleaning the database.
WordPress accumulates junk very easily: revisions, auto-drafts, transients expired ones, trashed comments, spam, orphaned metadata and plugin leftovers.
To do it, I opened the site shell from Local WP:
Local WP > your site > Open Site Shell
Before cleaning, I made a database backup:
wp db export backup-before-cleanup.sql
Then I ran this cleanup block:
wp post delete $(wp post list --post_type='revision' --format=ids) --force
wp post delete $(wp post list --post_status='auto-draft' --format=ids) --force
wp post delete $(wp post list --post_status='trash' --format=ids) --force
wp comment delete $(wp comment list --status=spam --format=ids) --force
wp comment delete $(wp comment list --status=trash --format=ids) --force
wp transient delete --expired
wp db query "DELETE pm FROM wp_postmeta pm LEFT JOIN wp_posts p ON p.ID = pm.post_id WHERE p.ID IS NULL;"
wp db query "DELETE cm FROM wp_commentmeta cm LEFT JOIN wp_comments c ON c.comment_ID = cm.comment_id WHERE c.comment_ID IS NULL;"
wp db query "DELETE tm FROM wp_termmeta tm LEFT JOIN wp_terms t ON t.term_id = tm.term_id WHERE t.term_id IS NULL;"
wp db query "DELETE um FROM wp_usermeta um LEFT JOIN wp_users u ON u.ID = um.user_id WHERE u.ID IS NULL;"
wp db optimize
One thing to watch out for: this assumes the table prefix is wp_.
If you’re on Windows and that variable syntax doesn’t work for you, use the prefix it returns directly:
wp db prefix
and replace it manually.
This step is not something to do casually in production. Locally, with a prior backup, yes.
Result
After these five steps, Local WP started running quite a bit better. Logical, because my Ryzen 7 2700 Pro with NVMe and 24GB is considerably more powerful than the production server.
That’s why it was clear to me that it was worth spending a bit of time.
Now it runs as it should and has saved me a lot of small waits.
The summary would be:
- Check that Xdebug is disabled.
- Change the domain from .local to .test.
- Exclude Local WP folders in Windows Defender.
- Disable unnecessary plugins locally.
- Clean the database from the shell.
Basically, take some weight off the environment.
In this case Local WP is not slow for one single reason, but because of the sum of small things: domain resolution, antivirus looking at every file, unnecessary plugins and a database full of leftovers.
I didn’t measure each one with a stopwatch, but by feel. That’s why I know what worked for me.
Now I have my local copy running like a rocket, so I’ve run out of excuses for working in production and not testing.
And you, are you still using the same excuse?
Frequently asked questions
Why is Local WP slow on Windows?
Local WP can be slow on Windows for several accumulated reasons: local domain resolution, antivirus scanning too many files, Xdebug enabled, unnecessary plugins or a local database full of leftovers. There is not always a single culprit.
Is it better to use .test than .local in Local WP?
In many cases, yes. Changing the domain from.localto.testcan improve local site resolution and avoid unnecessary network problems. It’s a simple change and, if Local WP is slow, it is worth trying.
Can Xdebug slow down Local WP?
Yes. Xdebug is very useful for debugging PHP, but if you are not using it, it can add load to the environment. That is why it is best to keep it disabled unless you are doing real debugging.
Is it safe to exclude Local WP folders in Windows Defender?
It can be done carefully. The idea is not to disable the antivirus, but to exclude specific folders in the local environment to prevent Windows Defender from constantly inspecting thousands of small WordPress files. The prudent thing is to limit exclusions to Local WP paths and your local sites.
Which folders should I exclude from the antivirus if I use Local WP?
The most important one is usuallyC:UsersYOUR_USERLocal Sites, because that is where your local websites, plugins, themes, uploads and files constantly touched by Local WP are. It can also make sense to review Local’s internal folders inAppDataLocalProgramsLocalandAppDataRoamingLocal.
Does disabling plugins improve Local WP performance?
It can help, although it will not always be the most important change. Locally, backup, security, cache, analytics, scheduled task or external integration plugins are often unnecessary. If you do not need them for what you are testing, it is better to disable them.
How can I clean the WordPress database in Local WP?
You can do it from the site shell using WP-CLI. Before touching anything, it is worth exporting a backup withwp db export. Then you can delete revisions, auto-drafts, spam, expired transients and orphaned metadata, and finish withwp db optimize.
Can I use these cleanup commands in production?
Not casually. These commands make sense locally and with a prior backup. In production, you need to review each action more carefully, confirm the table prefix and make sure nothing necessary is deleted.
Do I have to switch from Local WP to Docker if it is slow?
Not necessarily. Before changing environments, it is worth trying simple tweaks: disable Xdebug, use.test, exclude antivirus folders, reduce active plugins and clean the database. In many cases, removing ballast from the environment is enough.
Which tweak can improve Local WP the most on Windows?
It depends on the case. In this article, the clearest changes were moving from.localto.testand excluding Local WP folders in Windows Defender. The improvement usually comes from adding several tweaks, not from a magic solution.

Leave a Reply