انتقل إلى المحتوى

الدروس ووردبريس متوسط1 دقائق قراءة

How to Change Your WordPress Site URL

Change the WordPress Address and Site Address safely — in Settings, wp-config.php or the database — and fix links after moving to a new domain or to HTTPS.

بواسطة فريق تحرير ZSOLNET آخر تحديث

هذه الصفحة غير متاحة بالعربية بعد، لذا تُعرض بالإنجليزية.

أهم النقاط

  • WordPress stores two addresses: the WordPress Address and the Site Address.
  • A wrong URL can lock you out — wp-config.php overrides fix it.
  • Run a search-and-replace afterwards to update links inside content.

Option 1: Settings → General

  1. Log in to wp-admin and open Settings → General.
  2. Update WordPress Address (URL) and Site Address (URL) — for example from http:// to https://.
  3. Click Save Changes. You’ll be logged out and can log in at the new address.
yourdomain.com/wp-admin
  • Dashboard
  • Posts
  • Media
  • Pages
  • Appearance
  • Plugins
  • Users
  • Tools
  • Settings
    • General1
    • Reading
    • Permalinks

General

Save Changes
1 Change both addresses together, then save.

Option 2: wp-config.php (when locked out)

Add these lines above /* That's all, stop editing! */:

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

Old URLs remain inside posts and settings. Replace them with WP-CLI (take a backup first):

wp search-replace 'http://old-domain.com' 'https://example.com' --skip-columns=guid

Finish up

Clear caches, check for mixed-content warnings, and redirect the old address with 301s.

الأسئلة الشائعة

I changed the URL and now I can't log in.

Define WP_HOME and WP_SITEURL in wp-config.php with the correct address, then log in and correct Settings → General.

Do I need redirects after changing domain?

Yes. Add 301 redirects from the old domain to the new one so visitors and search engines follow.

شارك X LinkedIn Facebook

الدخول إلى حسابك

أدِر نطاقاتك واستضافتك وفواتيرك من مكان واحد.

اتصال آمن مباشرة مع منطقة العملاء في ZSOLNET.

ليس لديك حساب؟