Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

dwenaus's avatar

Advice on moving complex legacy WordPress app to Laravel

We have to major code bases in our company, one new one written in Laravel, which we love to work on. And our main legacy money-maker written as a set of WordPress plugins. This legacy app runs our SaaS retreat booking platform using wordpress multisite.

What I'd like to do is gradually refactor our legacy WP app into using the Laravel framework. Yes it will be a massive amount of work, but I believe it will be worth it in the end. We have about 400 automated tests already written, so we have some safety net as we refactor.

In the short term we'll probably keep the WP admin interface because it's quite functional and people are familiar with it. But our core app logic I'd like to gradually move over to Laravel.

My ideas for steps:

  • boot wordpress when starting laravel (ie. include ../../wp-load.php)
  • intelligently deal with routes so that they continue to work for wordpress
  • consider using something like https://github.com/corcel/corcel to access wp db

So, has anyone tried this? Have I lost my mind even considering such a move? Should I instead move towards just using various Symfony and Laravel components instead of the entire framework? Any other tools or advice?

0 likes
1 reply
jekinney's avatar

Yes. What we did, as the company wanted value asap, is port feature to feature and db tables that supported those features. We used vue for the front end and laravel as an API. This allowed injecting new "pages" into existing Wordpress themed pages. In the vue pages vue router caught the required routes others wise Wordpress handled them as default.

As it progressed we finally where able to set the domain to a new server that was 100% vue.

We decided on vue frontend mainly because we could inject via components new and re-done features that only communicated with laravel. Utilizing props we passed in the user information as needed. We then just copy and pasted with minor updates (using vuex versus 100% component scoped data and obviously user info). So updating the vue full app wasn't a huge deal/time.

We also killed two birds with one stone in our situation as some of the users wanted API access anyways for certain content. This obviously was in place already with out dublication as the vue app also utilized authentication via oauth style (passport) and cors. So users just grabbed a key pair and hit end points as needed.

It was still a pain as your maintaining one app while building another so you end up switching a lot, which is more of a mindset issue then anything. Like switching from php to JavaScript.

Other then that it was seemless and very little issues. The client was happy to see continues progress and end users had 0 interruptions except that some routes changed that they favorited and forcing setting new passwords when the final switch was complete (messages where displayed but still...).

1 like

Please or to participate in this conversation.