PHPackages                             giantpeach/acf-relative-urls - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. giantpeach/acf-relative-urls

ActiveWordpress-muplugin[Utility &amp; Helpers](/categories/utility)

giantpeach/acf-relative-urls
============================

Stores ACF link/URL fields as relative paths for environment portability

013PHP

Since Jan 19Pushed 3mo agoCompare

[ Source](https://github.com/Giant-Peach-Design/acf-relative-urls)[ Packagist](https://packagist.org/packages/giantpeach/acf-relative-urls)[ RSS](/packages/giantpeach-acf-relative-urls/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

ACF Relative URLs
=================

[](#acf-relative-urls)

Stores ACF link and URL fields as relative paths for environment portability.

Problem
-------

[](#problem)

ACF stores link fields with absolute URLs. When migrating databases between environments (local → staging → production), these URLs break unless you run search-replace scripts.

Solution
--------

[](#solution)

This mu-plugin intercepts ACF field saves/loads:

- **On save**: Converts internal absolute URLs to relative paths
- **On load**: Converts relative paths back to absolute URLs using current site URL

Installation
------------

[](#installation)

### Via Composer (Bedrock)

[](#via-composer-bedrock)

```
composer require giantpeach/acf-relative-urls
```

### Manual

[](#manual)

Copy `acf-relative-urls.php` to your `mu-plugins` directory.

How It Works
------------

[](#how-it-works)

ActionInputStored in DBSave (local)`https://mysite.lndo.site/about``/about`Load (local)`/about``https://mysite.lndo.site/about`Load (production)`/about``https://mysite.com/about`External URLs (e.g., `https://google.com`) are not modified.

Supported Field Types
---------------------

[](#supported-field-types)

- `link` - ACF Link field (array with url, title, target)
- `url` - ACF URL field (plain string)

License
-------

[](#license)

MIT

###  Health Score

20

—

LowBetter than 14% of packages

Maintenance53

Moderate activity, may be stable

Popularity7

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity12

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://www.gravatar.com/avatar/e66b81ebd507f82992c477ab3e567933436d0a810a0886e6005b2e8b0fdf317a?d=identicon)[Giant Peach](/maintainers/Giant%20Peach)

---

Top Contributors

[![tom-gurney](https://avatars.githubusercontent.com/u/6736496?v=4)](https://github.com/tom-gurney "tom-gurney (2 commits)")

### Embed Badge

![Health badge](/badges/giantpeach-acf-relative-urls/health.svg)

```
[![Health](https://phpackages.com/badges/giantpeach-acf-relative-urls/health.svg)](https://phpackages.com/packages/giantpeach-acf-relative-urls)
```

###  Alternatives

[halfpastfouram/phpchartjs

PHP library for ChartJS

2512.2k](/packages/halfpastfouram-phpchartjs)[axllent/silverstripe-analytics-js

Google Universal Analytics tracking code for Silverstripe

1721.3k](/packages/axllent-silverstripe-analytics-js)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
