{"id":18841274,"url":"https://github.com/dmhendricks/wordpress-rewrite-content-urls-plugin","last_synced_at":"2026-05-01T18:32:02.604Z","repository":{"id":88694439,"uuid":"129635738","full_name":"dmhendricks/wordpress-rewrite-content-urls-plugin","owner":"dmhendricks","description":"This plugin allows you to rewrite URLs in WordPress content, primarily created for developers sync'ing data from production to local development.","archived":false,"fork":false,"pushed_at":"2018-07-04T18:28:35.000Z","size":199,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-11T21:14:15.402Z","etag":null,"topics":["staging","staging-environment","sync","url-rewrite","wordpress","wordpress-development","wordpress-plugin","wordpress-sync"],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dmhendricks.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-04-15T17:49:25.000Z","updated_at":"2023-01-20T23:59:23.000Z","dependencies_parsed_at":null,"dependency_job_id":"ff0e00d8-f2f8-47e3-83c3-3c119d8fa88c","html_url":"https://github.com/dmhendricks/wordpress-rewrite-content-urls-plugin","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/dmhendricks/wordpress-rewrite-content-urls-plugin","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dmhendricks%2Fwordpress-rewrite-content-urls-plugin","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dmhendricks%2Fwordpress-rewrite-content-urls-plugin/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dmhendricks%2Fwordpress-rewrite-content-urls-plugin/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dmhendricks%2Fwordpress-rewrite-content-urls-plugin/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dmhendricks","download_url":"https://codeload.github.com/dmhendricks/wordpress-rewrite-content-urls-plugin/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dmhendricks%2Fwordpress-rewrite-content-urls-plugin/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32508900,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-30T13:12:12.517Z","status":"online","status_checked_at":"2026-05-01T02:00:05.856Z","response_time":64,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["staging","staging-environment","sync","url-rewrite","wordpress","wordpress-development","wordpress-plugin","wordpress-sync"],"created_at":"2024-11-08T02:50:38.091Z","updated_at":"2026-05-01T18:32:02.528Z","avatar_url":"https://github.com/dmhendricks.png","language":"PHP","funding_links":["https://paypal.me/danielhendricks"],"categories":[],"sub_categories":[],"readme":"[![Author](https://img.shields.io/badge/author-Daniel%20M.%20Hendricks-lightgrey.svg?colorB=9900cc )](https://www.danhendricks.com/??utm_source=github.com\u0026utm_medium=campaign\u0026utm_content=button\u0026utm_campaign=wordpress-rewrite-content-urls-plugin)\n[![Latest Version](https://img.shields.io/github/release/dmhendricks/wordpress-rewrite-content-urls-plugin.svg)](https://github.com/dmhendricks/wordpress-rewrite-content-urls-plugin/releases)\n[![GitHub License](https://img.shields.io/badge/license-GPLv2-yellow.svg)](https://raw.githubusercontent.com/dmhendricks/wordpress-rewrite-content-urls-plugin/master/LICENSE)\n[![FlyWheel](https://img.shields.io/badge/style-FlyWheel-green.svg?style=flat\u0026label=get%20hosted\u0026colorB=AE2A21)](https://share.getf.ly/e25g6k?utm_source=github.com\u0026utm_medium=referral\u0026utm_content=button\u0026utm_campaign=wordpress-network-subdomain-updater-plugin)\n[![Donate](https://img.shields.io/badge/Donate-PayPal-green.svg)](https://paypal.me/danielhendricks)\n[![Twitter](https://img.shields.io/twitter/url/https/github.com/dmhendricks/wordpress-rewrite-content-urls-plugin.svg?style=social)](https://twitter.com/danielhendricks)\n\n# Rewrite Content URLs\n\nThis plugin allows you to rewrite URLs in content.\n\nThis plugin was primarily designed for developers, useful for development/staging environments after syncing data from a MySQL dump.\n\n**DO NOT USE IN PRODUCTION:** This plugin should only be used for **development/staging** sites with frequently-synced data, as it creates a performance penalty.\n\n:pushpin: Use in conjunction with: [Network Sub-domain Updater](https://github.com/dmhendricks/wordpress-network-subdomain-updater-plugin) for WordPress multisite\n\n## Requirements\n\n* WordPress 4.5 or higher\n* **PHP 7.0** or higher\n* **[output-buffering.php](https://github.com/dmhendricks/wordpress-output-buffering)** *must* be copied to your WordPress `mu-plugins` directory.\n\nThis plugin *will not work* on versions of PHP below 7.0.\n\n## Installation\n\n1. Download and unzip the plugin to your WordPress plugins directory.\n1. Open `wp-config.php` for your site and define the `REWRITE_URL_PATTERNS` constant.\n1. Activate the plugin.\n\nThere is no settings page in WP Admin for this plugin. All options are configured through `wp-config.php` constants.\n\n### Configuration\n\nIn order for this plugin to work, you must add a `REWRITE_URL_PATTERNS` constant to your `wp-config.php`.\n\nExample of simply replacing the page links' domain:\n```php\ndefine( 'REWRITE_URL_PATTERNS', [ '/mydomain.com/' =\u003e 'mydomain.local' ] );\n```\n\nExample of simply replacing the page links' domain AND stripping 'www' (useful if your local development stack doesn't alias it):\n```php\ndefine( 'REWRITE_URL_PATTERNS', [ '/(www.)?mydomain.com/' =\u003e 'mydomain.local' ] );\n```\n\nSince the constant expects an array, you and add multiple match expressions.\n\n## Use Case\n\nLet's say you run a WordPress Network of sub-domains. If you did a MySQL dump from your production server  (example.com) and then imported to your staging (staging.example.com) or local development (example.local) instance and **[updated the domains](https://github.com/dmhendricks/wordpress-network-subdomain-updater-plugin)**, the links in your page content will be pointing to the production site.\n\nThis plugin replaces URL patterns in content, defined by `REWRITE_URL_PATTERNS` constant.\n\nFor example, I use [Local by Flywheel](https://local.getflywheel.com/) for local WordPress development:\n\n1. Create a local WordPress multisite instance.\n1. Copy necessary file assets (plugins, themes, uploads, etc) from the remote site.\n1. Install this plugin on your staging or development instance (not on production!)\n4. Define the `REWRITE_URL_PATTERNS` in `wp-config.php`.\n\nNow when you view pages on your instance, the links will be rewritten to your new domain.\n\n## Frequently Asked Questions\n\n**Q: Why did you use a constant to define the replacement URLs and not a settings page in WP Admin?**\n\nA: This plugin was designed for developers who sync data via a MySQL dump from a production site to staging/local development. Because of this, any settings set in WP Admin would be blown away.\n\n## Future Ideas\n\n* Ability to rewrite image URLs\n* Ability to set filter exceptions\n* Possibility of moving configuration to file\n\n## Change Log\n\nRelease changes are noted on the [Releases](https://github.com/dmhendricks/wordpress-rewrite-content-urls-plugin/releases) page.\n\n#### Branch: `master`\n\n* None since release\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdmhendricks%2Fwordpress-rewrite-content-urls-plugin","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdmhendricks%2Fwordpress-rewrite-content-urls-plugin","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdmhendricks%2Fwordpress-rewrite-content-urls-plugin/lists"}