Fix WebRequest Issues in MetaTrader 5
Complete Guide for macOS and Windows
What Is the Problem?
If your Expert Advisor (EA) needs to send data to the internet — such as to Google Sheets, a webhook, or the AIOTA server — you must first add the destination web addresses to MetaTrader’s approved URL list under Expert Advisors settings. This feature is called Allow WebRequest for listed URL.
Sometimes this section stops working: you can no longer add new addresses or delete existing ones, and your EA can no longer communicate with external services.
Symptoms
You have a WebRequest problem if any of the following apply:
- در ابزارها → Options → Expert Advisors, you type a URL and press Enter, but it disappears without being saved
- The delete button for existing URLs does nothing
- The EA shows this error in the Experts tab:
error 5203 - ERR_WEBREQUEST_CONNECT_FAILED
- The EA tells you to add an address to the allowed URL list, but the error persists even after adding it
- Position data is not being sent to Google Sheets or your server
Why Does This Happen?
MetaTrader 5 stores its allowed WebRequest URLs in an encrypted format inside a file called common.ini. You cannot read or edit this file directly.
The problem is typically caused by one of the following:
1. Automatic MetaTrader Update MetaTrader 5 updates itself automatically. Certain new builds — especially on macOS — introduce a bug that breaks the WebRequest URL management interface.
2. macOS-Specific Issue The macOS version of MetaTrader 5 runs through an internal compatibility layer called Wine. In this environment, the WebRequest URL list interface sometimes fails silently — URLs you enter appear to be accepted but are never actually saved.
3. Corrupted Settings File If MetaTrader crashed while saving settings, or if antivirus software locked the settings file mid-write, the encrypted data can become corrupt.
Quick Fix (Try This First)
Before reinstalling, try these steps:
Step 1: Fully close MetaTrader.
- Use File → Exit from the menu
- On Windows: check the System Tray (bottom-right of screen) — if the MetaTrader icon is there, right-click it and choose Exit
- On macOS: right-click the MetaTrader icon in the Dock and choose Quit
Step 2: Reopen MetaTrader with administrator privileges:
- Windows: Right-click the MetaTrader shortcut → Run as administrator
- macOS: Skip this step and proceed to Step 3
Step 3: Go to ابزارها → Options → Expert Advisors and try adding the URL again.
If this does not work, proceed to the full reinstallation below.
Full Solution: Reinstalling MetaTrader 5
Back Up Your Data First
Back Up Your Data First
⚠️ Important: Always back up before reinstalling so you don’t lose your EAs and chart settings.
Step 1 — Find the Data Folder:
Open MetaTrader and go to File → Open Data Folder. A folder window will open.
Step 2 — Copy these subfolders to a safe location (e.g., your Desktop):
Folder | Contents |
|---|---|
MQL5/Experts | Expert Advisors (.mq5 and .ex5 files) |
MQL5/Indicators | Custom indicators |
MQL5/Scripts | Scripts |
profiles | Chart layout settings |
templates | Chart templates |
Close MetaTrader before proceeding.
Reinstalling on Windows
Step 1 — Uninstall MetaTrader:
Standard method:
- Open Control Panel → Programs → Uninstall a program
- Find MetaTrader 5 (it may be listed under your broker’s name, e.g., “Exness MT5”)
- Right-click → Uninstall
- Follow the prompts to complete uninstallation
Alternative (if Uninstall is not available):
- Find the MetaTrader installation folder — typically:
- C:\Program Files\MetaTrader 5\
- C:\Program Files (x86)\MetaTrader 5\
- Or a broker-named folder like C:\Program Files\Exness MT5\
- Find and run uninstall.exe inside that folder
Step 2 — Remove leftover files:
After uninstalling, delete this folder to remove all cached settings:
C:\Users\[YourUsername]\AppData\Roaming\MetaQuotes\Terminal\
Tip: The AppData folder is hidden by default. In File Explorer, go to View → Show → Hidden items to make it visible.
Step 3 — Download a fresh copy:
Two options:
Option A — Download from MetaQuotes (generic version):
https://download.terminal.free/cdn/web/metaquotes.ltd/mt5/mt5setup.exe
Option B — Download from your broker’s website (recommended): Most brokers provide their own MT5 installer which is pre-configured for their servers. Check your broker’s website for a download link.
Step 4 — Install:
- Run the downloaded installer
- Accept the default installation path (recommended)
- MetaTrader will launch automatically after installation
Step 5 — Log in to your account:
- Go to File → Login to Trade Account
- Enter your account number, password, and broker server name
Step 6 — Restore your EAs and settings:
- In MetaTrader, go to File → Open Data Folder
- Copy the backed-up folders (MQL5, profiles, templates) back into the new Data Folder
Step 7 — Add WebRequest URLs:
- Go to ابزارها → Options → Expert Advisors
- Check the box Allow WebRequest for listed URL
- Add the required URLs (one per line):
- https://script.google.com
- Any other server addresses your EA uses (check your EA documentation)
- Click OK
Reinstalling on macOS
⚠️ Note: MetaTrader on macOS uses an internal Wine layer. A complete uninstall requires removing several folders — just deleting the app is not enough.
Step 1 — Back up your data (if not done yet):
Open Terminal (search for “Terminal” in Spotlight) and run:
cp -r ~/Library/Application\ Support/net.metaquotes.wine.metatrader5/drive_c/users/user/AppData/Roaming/MetaQuotes/Terminal ~/Desktop/MT5_Backup
If this path doesn’t work, use File → Open Data Folder inside MetaTrader and manually copy the folder to your Desktop.
Step 2 — Fully quit MetaTrader:
- Right-click the MetaTrader icon in the Dock
- Click Quit
- Wait a few seconds to ensure it is completely closed
Step 3 — Delete the application:
- Open Finder → Applications
- Drag MetaTrader 5 to the Trash (or right-click → Move to Trash)
Step 4 — Remove the Wine data folder (critical step):
Open Terminal and run this command exactly as written:
rm -rf ~/Library/Application\ Support/net.metaquotes.wine.metatrader5/
⚠️ This command permanently deletes all MetaTrader Wine data. Type it carefully — if your backup is on your Desktop, it is already safe.
To confirm the folder is gone:
ls ~/Library/Application\ Support/ | grep metaquotes
If the command returns nothing, the folder has been successfully removed.
Step 5 — Download a fresh copy for macOS:
https://download.terminal.free/cdn/web/metaquotes.ltd/mt5/MetaTrader5.pkg.zip
Or download the macOS version from your broker’s website.
Step 6 — Install:
- Unzip the downloaded .zip file
- Double-click the .pkg installer
- Follow the installation prompts
- If macOS shows a warning (“app from unidentified developer”), go to System Settings → Privacy & Security → scroll down and click Open Anyway
Step 7 — Log in to your account:
- MetaTrader will open after installation
- Go to File → Login to Trade Account
- Enter your account number, password, and broker server name
Step 8 — Restore your EAs and settings:
- In MetaTrader, go to File → Open Data Folder
- Copy the backed-up MQL5, profiles, and templates folders into the new Data Folder
Step 9 — Add WebRequest URLs:
- Go to ابزارها → Options → Expert Advisors
- Check the box Allow WebRequest for listed URL
- Add the required URLs:
- https://script.google.com
- Any other addresses required by your EA
- Click OK
Verifying That WebRequest Is Working
After reinstalling and adding your URLs, attach the EA to a chart and check the Experts tab.
Working correctly looks like this:
TTJ HTTP OK | code=200
Troubleshooting remaining errors:
Error | Meaning | Solution |
|---|---|---|
err=5203 | URL not in allowed list | Re-add the URL in Options |
code=1003 | Connection failed | Check your internet and firewall |
TTJ SLOW | drain_http | 4000ms | Server responded slowly | Normal — not a problem |
err=4014 | WebRequest is disabled | Enable “Allow WebRequest” in Options |
Frequently Asked Questions
Will I lose my trading history after reinstalling?
No. Your trade history is stored on your broker's server and will reappear automatically after you log back in.
Will I lose my EAs and indicator settings?
Only if you did not back up. If you followed the backup steps above, everything can be fully restored by copying the backed-up folders back.
Why does MetaTrader encrypt the URL list in the first place?
It is a security measure to prevent other applications from easily reading or modifying the list of trusted external connections. Unfortunately, this encryption also makes it harder to fix when it breaks.
Will this problem come back after an update?
Possibly — especially on macOS. If MetaTrader updates itself and the problem reappears, repeating the reinstallation steps will resolve it.
Can I prevent automatic updates?
In some MetaTrader versions: ابزارها → Options → Updates — you may see an option to disable automatic updates. However, this option is not available in all builds.