What is GUIDs in WordPress?
What is GUIDs in WordPress?
A GUID (Globally Unique Identifier) in WordPress is a unique string stored in the wp_posts.guid column for every post, page, attachment, etc.
Example:
https://example.com/?p=123
Originally, WordPress used this as a permanent, unique identifier for each piece of content — especially for feeds like RSS.
Important: GUID is NOT a URL
Even though a GUID may look like a URL, it is not meant to function as one.
Key Points:
- It is not a live link
- It is used as a unique identifier
- It is primarily used by RSS feed readers
Feed readers rely on GUIDs to determine whether content is new or already seen.
Why WordPress Warns About GUIDs
WordPress strongly advises:
Do NOT change GUIDs after content is published
Why?
- Feed readers depend on GUID stability
- Changing GUIDs makes old content appear as new content
- This can result in:
- Duplicate posts in RSS readers
- Re-publishing content unintentionally
When Should You Update GUIDs?
👉 Almost never.
However, there are a few specific scenarios where updating GUIDs is acceptable.
✅ 1. Site Migration (Local → Staging → Production)
If your GUIDs contain something like:
http://localhost/site/?p=123
After moving to production:
https://example.com/?p=123
You can update GUIDs only if:
- The site has never been public
- No RSS feeds were consumed externally
- It is a fresh launch or internal environment
❌ 2. Live Site Migration
If your site is already:
- Public
- Indexed by search engines
- Subscribed via RSS
🚫 Do NOT update GUIDs
Even if:
- Domain changes
- URLs change (HTTP → HTTPS)
- You rebrand
✅ 3. Cloning a Site
If you are cloning a site to create a new, independent website:
✔ You should update GUIDs to avoid:
- Duplicate GUIDs across different sites
- Feed conflicts
❌ 4. SEO or URL Changes
If you are changing:
- Permalinks
- Domain structure
- URL formats
🚫 Do NOT modify GUIDs
Instead:
- Use proper 301 redirects
- Update
homeandsiteurl - Perform search-replace only in safe fields
Practical Rule of Thumb
| Scenario | Update GUID? |
|---|---|
| Local → Live (never public) | ✅ Yes |
| Staging → Production (private) | ✅ Yes |
| Live site domain change | ❌ No |
| HTTP → HTTPS migration | ❌ No |
| SEO permalink changes | ❌ No |
| Cloning to a new independent site | ✅ Yes |
Safe Migration Practices
When performing search-replace (via SQL, WP-CLI, or plugins):
✅ Safe to replace:
post_contentmeta_value
❌ Do NOT replace:
guid
Why GUID Exists
Historically:
- RSS feeds were the primary way to distribute content
- GUID ensured global uniqueness across systems
- Prevented duplication across feed readers
Simple Mental Model
GUID = Permanent identity (like an Aadhaar number)
Permalink = Current address (can change)
Summary
- GUID is a unique identifier, not a URL
- Never change GUIDs on a live site
- Only update GUIDs in controlled, non-public environments
- Always exclude GUID during migrations