{"id":4262,"date":"2022-08-19T10:28:00","date_gmt":"2022-08-19T15:28:00","guid":{"rendered":"https:\/\/wpengine.com\/blog\/wordpress-laravel\/"},"modified":"2022-08-19T10:28:00","modified_gmt":"2022-08-19T15:28:00","slug":"wordpress-laravel","status":"publish","type":"post","link":"https:\/\/wpengine.com\/blog\/wordpress-laravel\/","title":{"rendered":"Laravel And WordPress Integration"},"content":{"rendered":"<p>Developing web applications can take a lot of time and resources. If you work with WordPress, you might be wondering if there\u2019s a better way to integrate your web development process with your Content Management System (CMS).<\/p>\n\n\n\n<p>Fortunately, one of the most popular Hypertext Preprocessing (PHP) programming frameworks, <a data-analytics-action-type=\"link\" data-analytics-link-location=\"Post Content\" data-analytics-link-type=\"outbound\" href=\"https:\/\/laravel.com\/\" target=\"_blank\" rel=\"noreferrer noopener\">Laravel<\/a>, can be integrated with <a data-analytics-action-type=\"link\" data-analytics-link-location=\"Post Content\" data-analytics-link-type=\"outbound\" href=\"https:\/\/wordpress.org\/\" target=\"_blank\" rel=\"noreferrer noopener\">WordPress<\/a>. This combination can enable you to manage your web application development through the WordPress back end, offering a more streamlined workflow.&nbsp;<\/p>\n\n\n\n<p>In this article, we\u2019ll learn more about Laravel and how it can be used alongside WordPress. We\u2019ll also review the pros and cons of this approach. Let\u2019s get started!&nbsp;<\/p>\n\n\n\n\n\n<h2 id=\"toc-what-is-laravel\" class=\"wp-block-heading\">What Is Laravel?<\/h2>\n\n\n\n<p><a data-analytics-action-type=\"link\" data-analytics-link-location=\"Post Content\" data-analytics-link-type=\"outbound\" href=\"https:\/\/laravel.com\/\">Laravel<\/a> is a popular PHP framework. A framework can help speed up the web application development process. It provides a basic structure, and can help promote rapid application development (RAD) and avoid repetitive coding processes.<\/p>\n\n\n\n<p>Additionally, using a framework like Laravel can also help developers of all levels build more stable applications, by ensuring the use of proper syntax and database interactions. If you\u2019re new to PHP frameworks, you might want to familiarize yourself with a few important terms, including:&nbsp;<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Model View Controller (MVC).<\/strong> This is an architectural structure that separates the three components of PHP development: the Model, the View, and the Controller. This means a developer can isolate each part and make changes without impacting the other components.&nbsp;<\/li>\n\n\n\n<li><strong>Object-Oriented Programming.<\/strong> In an object-oriented programming approach, such as PHP, structures are built with data or \u2018Objects\u2019, rather than function and logic. They can then be used throughout the program. Each Object has Properties and Behaviors that define its state and what it can do.<\/li>\n\n\n\n<li><strong>REST API.<\/strong> This is an <a data-analytics-action-type=\"link\" data-analytics-link-location=\"Post Content\" data-analytics-link-type=\"outbound\" href=\"https:\/\/restfulapi.net\/\" target=\"_blank\" rel=\"noreferrer noopener\">architectural style<\/a> used by most open-source web applications to form a workable exchange of information.<\/li>\n\n\n\n<li><strong>Composer.<\/strong> This is a tool used to <a data-analytics-action-type=\"link\" data-analytics-link-location=\"Post Content\" data-analytics-link-type=\"outbound\" href=\"https:\/\/getcomposer.org\/\" target=\"_blank\" rel=\"noreferrer noopener\">manage the dependencies<\/a> in your project. You can tell Composer what libraries your project requires, and Composer will monitor, install, and update them to ensure that your program will continue to function.&nbsp;&nbsp;<\/li>\n<\/ul>\n\n\n\n<p>It\u2019s important to understand that while both Laravel and WordPress are PHP-based systems, there is still a bit of complicated coordination that is necessary for them to integrate in a functional way.&nbsp;<\/p>\n\n\n\n<h2 id=\"toc-pros-and-cons-of-using-laravel-with-wordpress\" class=\"wp-block-heading\">Pros and Cons of Using Laravel With WordPress <\/h2>\n\n\n\n<p>Integrating Laravel with WordPress can be very effective, although it does require some higher level programming knowledge. In addition, there are some distinct pros and cons to this approach that you\u2019ll want to keep in mind.<\/p>\n\n\n\n<p>The advantages of using Laravel alongside WordPress include:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Streamlining your web design and web application projects by sharing data.&nbsp;<\/li>\n\n\n\n<li>Creating web applications that look more like your website, to provide consistency in the customer experience.&nbsp;<\/li>\n\n\n\n<li>Retaining the simplicity of a familiar WordPress administration panel for clients, while maximizing Laravel for high-end development on the front end.&nbsp;<\/li>\n<\/ul>\n\n\n\n<p>There are also some drawbacks, however, because:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>WordPress does not natively support Composer, so integration can be tricky.<\/li>\n\n\n\n<li>Integration ideally requires a full-time, skilled developer to be on staff and available to manage all aspects of the setup.&nbsp;<\/li>\n<\/ul>\n\n\n\n<p>You can check out an example of how this approach can be used by viewing the <a data-analytics-action-type=\"link\" data-analytics-link-location=\"Post Content\" data-analytics-link-type=\"outbound\" href=\"https:\/\/laravel-news.com\/wordpress-and-laravel\" target=\"_blank\" rel=\"noreferrer noopener\">Laravel News website<\/a>. There, Laravel was used to create the front-end experience, while bringing in data that was created in the user-friendly WordPress back end.<\/p>\n\n\n\n<p>While there are quite a few benefits to integrating Laravel with WordPress, it should not be undertaken lightly. Keeping a developer on payroll would be best if this is an approach you want to explore.<\/p>\n\n\n\n<h2 id=\"toc-using-laravel-with-wordpress\" class=\"wp-block-heading\">Using Laravel With WordPress<\/h2>\n\n\n\n<p>Integrating Laravel with WordPress can be accomplished in a couple of ways. We\u2019ll take a look at two: a more hands-on and manual approach, followed by a specialized plugin. The following steps assume that you\u2019re <a data-analytics-action-type=\"link\" data-analytics-link-location=\"Post Content\" data-analytics-link-type=\"outbound\" href=\"https:\/\/laravel.com\/docs\/10.x\" target=\"_blank\" rel=\"noreferrer noopener\">already using Laravel<\/a>.<\/p>\n\n\n\n<h3 id=\"toc-using-wordpress-corcel\" class=\"wp-block-heading\">Using WordPress Corcel<\/h3>\n\n\n\n<p><a data-analytics-action-type=\"link\" data-analytics-link-location=\"Post Content\" data-analytics-link-type=\"outbound\" href=\"https:\/\/github.com\/corcel\/corcel\" target=\"_blank\" rel=\"noreferrer noopener\">Corcel<\/a> is a set of PHP Model classes that enable programmers to retrieve and use information directly from WordPress. It can function as a bridge between WordPress and Laravel.<\/p>\n\n\n\n<p>By installing Corcel, you\u2019ll be able to use WordPress as the back-end administration of your project for inserting data, such as posts or custom post types, into your Laravel application.&nbsp;<\/p>\n\n\n\n<h4 id=\"toc-step-1-install-corcel\" class=\"wp-block-heading\">Step 1: Install Corcel<\/h4>\n\n\n\n<p>To get started with Corcel, you\u2019ll need to <a data-analytics-action-type=\"link\" data-analytics-link-location=\"Post Content\" data-analytics-link-type=\"outbound\" href=\"https:\/\/getcomposer.org\/\" target=\"_blank\" rel=\"noreferrer noopener\">use Composer<\/a> to install it. You can find and <a data-analytics-action-type=\"link\" data-analytics-link-location=\"Post Content\" data-analytics-link-type=\"outbound\" href=\"https:\/\/github.com\/corcel\/corcel\" target=\"_blank\" rel=\"noreferrer noopener\">download Corcel<\/a> on GitHub. In your terminal application, you\u2019ll then need to execute the following command:&nbsp;<\/p>\n\n\n\n<p><code>composer require jgrossi\/corcel<\/code><\/p>\n\n\n\n<p>After that, you\u2019ll want to jump into your Laravel installation and configure a few settings.&nbsp;<\/p>\n\n\n\n<h4 id=\"toc-step-2-configure-laravel-for-corcel\" class=\"wp-block-heading\">Step 2: Configure Laravel for Corcel<\/h4>\n\n\n\n<p>If you\u2019re running Laravel 5.5 or later, Corcel will register itself with <a data-analytics-action-type=\"link\" data-analytics-link-location=\"Post Content\" data-analytics-link-type=\"outbound\" href=\"https:\/\/laravel.com\/docs\/5.5\/packages#package-discovery\" target=\"_blank\" rel=\"noreferrer noopener\">Laravel\u2019s AutoDiscovery function<\/a>.<\/p>\n\n\n\n<p>For older versions of the Laravel framework, you\u2019ll need to <a data-analytics-action-type=\"link\" data-analytics-link-location=\"Post Content\" data-analytics-link-type=\"outbound\" href=\"https:\/\/github.com\/corcel\/corcel#configuring-laravel\" target=\"_blank\" rel=\"noreferrer noopener\">manually register Corcel<\/a> and publish the configuration file using the following <a data-analytics-action-type=\"link\" data-analytics-link-location=\"Post Content\" data-analytics-link-type=\"outbound\" href=\"https:\/\/laravel.com\/docs\/5.0\/commands\" target=\"_blank\" rel=\"noreferrer noopener\">Artisan command<\/a> in your terminal application:&nbsp;<\/p>\n\n\n\n<p><code>php artisan vendor:publish <\/code><br><code>--provider=\"CorcelLaravelCorcelServiceProvider\"<\/code><\/p>\n\n\n\n<p>You\u2019ll now have a <code>config\/corcel.php<\/code> file that you can use to establish a database connection with WordPress.&nbsp;<\/p>\n\n\n\n<h4 id=\"toc-step-3-set-up-database-connection\" class=\"wp-block-heading\">Step 3: Set Up Database Connection<\/h4>\n\n\n\n<p>Once your <code>config\/corcel.php<\/code> has been created, you\u2019ll open it to set up connections to your WordPress database. This is what enables Laravel to retrieve post information and other items from your WordPress database tables.&nbsp;<\/p>\n\n\n\n<p>Whatever database name you provide in your <code>config\/database.php<\/code> file is what you\u2019ll need to insert in your <code>config\/corcel.php<\/code> file. This will enable Laravel and Corcel to use your WordPress database.&nbsp;<\/p>\n\n\n\n<h4 id=\"toc-step-4-set-your-project-parameters\" class=\"wp-block-heading\">Step 4: Set Your Project Parameters<\/h4>\n\n\n\n<p>There are a wide variety of ways you can use your new integration. You\u2019ll need to refer to the documentation to determine how to set the parameters. This will enable you to <a data-analytics-action-type=\"link\" data-analytics-link-location=\"Post Content\" data-analytics-link-type=\"outbound\" href=\"https:\/\/github.com\/corcel\/corcel#--usage\" target=\"_blank\" rel=\"noreferrer noopener\">establish connections<\/a> for posts, custom post types, shortcodes, taxonomies, custom fields, and more.&nbsp;<\/p>\n\n\n\n<h3 id=\"toc-using-a-plugin\" class=\"wp-block-heading\">Using a Plugin<\/h3>\n\n\n\n<p>Currently, we don\u2019t recommend using any plugins found in the WordPress Plugin Directory for Laravel WordPress integration. Most have not been maintained, and have not been tested with the latest versions of WordPress. There is, however, another option for integrating the two systems using a plugin-like solution.<\/p>\n\n\n\n<h4 id=\"toc-step-1-install-wordpress-pete\" class=\"wp-block-heading\">Step 1: Install WordPress Pete<\/h4>\n\n\n\n<p><a data-analytics-action-type=\"link\" data-analytics-link-location=\"Post Content\" data-analytics-link-type=\"outbound\" href=\"https:\/\/wordpresspete.com\/\" target=\"_blank\" rel=\"noreferrer noopener\">WordPress Pete<\/a> is an application built to function like a plugin, which easily integrates Laravel with your WordPress back end. To get started, you can try WordPress Pete on up to two websites for free.<\/p>\n\n\n\n<p>Once you download the software, you\u2019ll need Terminal to <a data-analytics-action-type=\"link\" data-analytics-link-location=\"Post Content\" data-analytics-link-type=\"outbound\" href=\"https:\/\/wordpresspete.com\/wordpresspete-mac-osx-installation\/\" target=\"_blank\" rel=\"noreferrer noopener\">install it for either MacOS or Linux<\/a>. You can use the following command on a Mac to get started:&nbsp;<\/p>\n\n\n\n<p>curl -o mac_installer.sh -L https:\/\/wordpresspete.com\/mac_installer.sh &amp;&amp; chmod 755 mac_installer.sh &amp;&amp; sh mac_installer.sh<\/p>\n\n\n\n<p>It may take some time for the entire package to install, but when it\u2019s complete, you\u2019ll be prompted to enter your computer\u2019s admin password.<\/p>\n\n\n\n<p>You can then set the PHP version you want to use, and select <em>Start Pete<\/em>.<\/p>\n\n\n\n<h4 id=\"toc-step-2-create-a-new-wordpress-website\" class=\"wp-block-heading\">Step 2: Create a New WordPress Website<\/h4>\n\n\n\n<p>Once you\u2019ve installed the WordPress Pete application, you\u2019ll need to visit the test site to create a new WordPress website for your application.&nbsp;<\/p>\n\n\n\n<p>To do that, you\u2019ll click on <em>Create New WordPress<\/em> in the upper right-hand corner. Next, you\u2019ll name your installation and designate the project\u2019s URL. From there, you can complete the <a data-analytics-action-type=\"link\" data-analytics-link-location=\"Post Content\" data-analytics-link-type=\"outbound\" href=\"https:\/\/wordpress.org\/support\/article\/how-to-install-wordpress\/\" target=\"_blank\" rel=\"noreferrer noopener\">WordPress installation process<\/a> as normal by visiting your admin URL.&nbsp;<\/p>\n\n\n\n<h4 id=\"toc-step-3-configure-wordpress-pete-settings\" class=\"wp-block-heading\">Step 3: Configure WordPress Pete Settings<\/h4>\n\n\n\n<p>Once you\u2019ve logged in to your new WordPress installation, you can navigate to the <em>Plugins<\/em> list. There, you\u2019ll see a <em>Lavarel Integration by WordPress Pete<\/em> plugin. This is installed automatically when you create a new WordPress site with WordPress Pete.<\/p>\n\n\n\n<p>You can now head over to <em>Settings<\/em> &gt; <em>Laravel Integration<\/em> to complete the integration steps. This involves approving the integration, and allowing cookies to function on all of your subdomains.<\/p>\n\n\n\n<p>Once you\u2019ve enabled the option, you\u2019ll need to select <em>Update Options<\/em> and log out of your WordPress installation. You can then log back into your WordPress dashboard, so the plugin can recognize the cookies setting.<\/p>\n\n\n\n<h4 id=\"toc-step-4-create-a-new-integration\" class=\"wp-block-heading\">Step 4: Create a New Integration<\/h4>\n\n\n\n<p>Now when you visit your WordPress Pete installation, you\u2019ll have the option to create a new <em>WordPress + Laravel<\/em> integration. You can select the menu option and proceed to configure the settings for your new integration.<\/p>\n\n\n\n<p>For example, if you name your new integration \u201cdashboard,\u201d you\u2019ll be able to access the code by going to <em>dashboard.yoururl.com.<\/em> Back in your preferred code editor, you\u2019ll now be able to connect to your installation and use the combined powers of Laravel and Corcel with WordPress!<\/p>\n\n\n\n<h2 id=\"toc-build-your-site-on-your-own-terms-with-wp\" class=\"wp-block-heading\">Build Your Site on Your Own Terms With WP Engine<\/h2>\n\n\n\n<p>Web application development should be fast and fun. For any WordPress developer, responding to user demands and needs with new applications can be rewarding, and increase progress toward sales or revenue goals.<\/p>\n\n\n\n<p>WP Engine is dedicated to sharing excellent <a data-analytics-action-type=\"link\" data-analytics-link-location=\"Post Content\" data-analytics-link-type=\"outbound\" href=\"https:\/\/developer.wordpress.org\/\" target=\"_blank\" rel=\"noreferrer noopener\">developer resources<\/a>, so you can focus on creating the best digital experience for your clients. Check out our industry-leading <a data-analytics-action-type=\"link\" data-analytics-link-location=\"Post Content\" data-analytics-link-type=\"internal\" href=\"https:\/\/wpengine.com\/wordpress-hosting\/\" target=\"_blank\" rel=\"noreferrer noopener\">hosting for WordPress<\/a> and our many <a data-analytics-action-type=\"link\" data-analytics-link-location=\"Post Content\" data-analytics-link-type=\"internal\" href=\"https:\/\/wpengine.com\/plans\/\" target=\"_blank\" rel=\"noreferrer noopener\">web hosting solutions<\/a> for your next project!&nbsp;<\/p>","protected":false},"excerpt":{"rendered":"<p>Developing web applications can take a lot of time and resources. If you work with WordPress, you might be wondering if there\u2019s a better way to integrate your web development process with your Content Management System (CMS). Fortunately, one of the most popular Hypertext Preprocessing (PHP) programming frameworks, Laravel, can be integrated with WordPress. This [&hellip;]<\/p>\n","protected":false},"author":15,"featured_media":2574,"comment_status":"","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"mediapress_draft_name":"","_mediapress_is_draft_copy":false,"_time_to_read":8,"footnotes":""},"audience":[],"blog-category":[121],"buyer-stage":[],"company-and-culture":[],"content-type":[54],"location":[],"persona":[106],"product":[],"topic":[95],"use-cases":[],"class_list":["post-4262","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","blog-category-best-practices","content-type-blog","persona-developer","topic-development"],"acf":{"hero_image_alt_text":"","featured_on_hub_page":false,"featured_on_tag_page":false,"featured_on_category_page":false,"wp_engine_pick":false,"display_author_bio":false,"taxonomy_selector":{"":null,"taxonomy-audience":false,"taxonomy-buyer-stage":false,"taxonomy-company-and-culture":false,"taxonomy-content-type":[54],"taxonomy-location":false,"taxonomy-persona":[106],"taxonomy-product":false,"taxonomy-topic":[95],"taxonomy-use-cases":false}},"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.3 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>How to Integrate WordPress &amp; Laravel<\/title>\n<meta name=\"description\" content=\"Want to integrate Laravel with WordPress? Figure out all the steps and code you need with our easy to follow guide!\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/wpengine.com\/blog\/wordpress-laravel\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to Integrate WordPress &amp; Laravel\" \/>\n<meta property=\"og:description\" content=\"Want to integrate Laravel with WordPress? Figure out all the steps and code you need with our easy to follow guide!\" \/>\n<meta property=\"og:url\" content=\"https:\/\/wpengine.com\/blog\/wordpress-laravel\/\" \/>\n<meta property=\"og:site_name\" content=\"WP Engine\u00ae\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/wpengine\/\" \/>\n<meta property=\"article:published_time\" content=\"2022-08-19T15:28:00+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/wpengine.com\/wp-content\/uploads\/2022\/08\/laravel-header.png\" \/>\n\t<meta property=\"og:image:width\" content=\"1\" \/>\n\t<meta property=\"og:image:height\" content=\"1\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Erin Myers\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@wpengine\" \/>\n<meta name=\"twitter:site\" content=\"@wpengine\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Erin Myers\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"8 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/wpengine.com\\\/blog\\\/wordpress-laravel\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/wpengine.com\\\/blog\\\/wordpress-laravel\\\/\"},\"author\":{\"name\":\"Erin Myers\",\"@id\":\"https:\\\/\\\/wpengine.com\\\/#\\\/schema\\\/person\\\/e317e5c0dfa4fca60914f6c1dfde2e0e\"},\"headline\":\"Laravel And WordPress Integration\",\"datePublished\":\"2022-08-19T15:28:00+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/wpengine.com\\\/blog\\\/wordpress-laravel\\\/\"},\"wordCount\":1501,\"publisher\":{\"@id\":\"https:\\\/\\\/wpengine.com\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/wpengine.com\\\/blog\\\/wordpress-laravel\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/wpengine.com\\\/wp-content\\\/uploads\\\/2022\\\/08\\\/laravel-header.png\",\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/wpengine.com\\\/blog\\\/wordpress-laravel\\\/\",\"url\":\"https:\\\/\\\/wpengine.com\\\/blog\\\/wordpress-laravel\\\/\",\"name\":\"How to Integrate WordPress & Laravel\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/wpengine.com\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/wpengine.com\\\/blog\\\/wordpress-laravel\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/wpengine.com\\\/blog\\\/wordpress-laravel\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/wpengine.com\\\/wp-content\\\/uploads\\\/2022\\\/08\\\/laravel-header.png\",\"datePublished\":\"2022-08-19T15:28:00+00:00\",\"description\":\"Want to integrate Laravel with WordPress? Figure out all the steps and code you need with our easy to follow guide!\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/wpengine.com\\\/blog\\\/wordpress-laravel\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/wpengine.com\\\/blog\\\/wordpress-laravel\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/wpengine.com\\\/blog\\\/wordpress-laravel\\\/#primaryimage\",\"url\":\"https:\\\/\\\/wpengine.com\\\/wp-content\\\/uploads\\\/2022\\\/08\\\/laravel-header.png\",\"contentUrl\":\"https:\\\/\\\/wpengine.com\\\/wp-content\\\/uploads\\\/2022\\\/08\\\/laravel-header.png\",\"caption\":\"PHP code. Laravel WordPress\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/wpengine.com\\\/blog\\\/wordpress-laravel\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/wpengine.com\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Laravel And WordPress Integration\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/wpengine.com\\\/#website\",\"url\":\"https:\\\/\\\/wpengine.com\\\/\",\"name\":\"WP Engine\u00ae\",\"description\":\"Managed Hosting for WordPress\",\"publisher\":{\"@id\":\"https:\\\/\\\/wpengine.com\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/wpengine.com\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/wpengine.com\\\/#organization\",\"name\":\"WP Engine\",\"url\":\"https:\\\/\\\/wpengine.com\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/wpengine.com\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/wpengine.com\\\/wp-content\\\/uploads\\\/2025\\\/09\\\/WPEngine_OGImage-1.webp\",\"contentUrl\":\"https:\\\/\\\/wpengine.com\\\/wp-content\\\/uploads\\\/2025\\\/09\\\/WPEngine_OGImage-1.webp\",\"width\":1200,\"height\":630,\"caption\":\"WP Engine\"},\"image\":{\"@id\":\"https:\\\/\\\/wpengine.com\\\/#\\\/schema\\\/logo\\\/image\\\/\"},\"sameAs\":[\"https:\\\/\\\/www.facebook.com\\\/wpengine\\\/\",\"https:\\\/\\\/x.com\\\/wpengine\",\"https:\\\/\\\/www.instagram.com\\\/wpengine\\\/\",\"https:\\\/\\\/www.linkedin.com\\\/company\\\/wpengine\\\/\",\"https:\\\/\\\/www.youtube.com\\\/channel\\\/UCJeAEAxX69v24CUBZ0WBYSg\"]},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/wpengine.com\\\/#\\\/schema\\\/person\\\/e317e5c0dfa4fca60914f6c1dfde2e0e\",\"name\":\"Erin Myers\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/cd881e115bc28c81642ec61752db9981ece9ee8b4c81498a9b6276b9cdcaf5e6?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/cd881e115bc28c81642ec61752db9981ece9ee8b4c81498a9b6276b9cdcaf5e6?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/cd881e115bc28c81642ec61752db9981ece9ee8b4c81498a9b6276b9cdcaf5e6?s=96&d=mm&r=g\",\"caption\":\"Erin Myers\"},\"url\":\"https:\\\/\\\/wpengine.com\\\/blog\\\/author\\\/erin-myers\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How to Integrate WordPress & Laravel","description":"Want to integrate Laravel with WordPress? Figure out all the steps and code you need with our easy to follow guide!","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/wpengine.com\/blog\/wordpress-laravel\/","og_locale":"en_US","og_type":"article","og_title":"How to Integrate WordPress & Laravel","og_description":"Want to integrate Laravel with WordPress? Figure out all the steps and code you need with our easy to follow guide!","og_url":"https:\/\/wpengine.com\/blog\/wordpress-laravel\/","og_site_name":"WP Engine\u00ae","article_publisher":"https:\/\/www.facebook.com\/wpengine\/","article_published_time":"2022-08-19T15:28:00+00:00","og_image":[{"url":"https:\/\/wpengine.com\/wp-content\/uploads\/2022\/08\/laravel-header.png","width":1,"height":1,"type":"image\/png"}],"author":"Erin Myers","twitter_card":"summary_large_image","twitter_creator":"@wpengine","twitter_site":"@wpengine","twitter_misc":{"Written by":"Erin Myers","Est. reading time":"8 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/wpengine.com\/blog\/wordpress-laravel\/#article","isPartOf":{"@id":"https:\/\/wpengine.com\/blog\/wordpress-laravel\/"},"author":{"name":"Erin Myers","@id":"https:\/\/wpengine.com\/#\/schema\/person\/e317e5c0dfa4fca60914f6c1dfde2e0e"},"headline":"Laravel And WordPress Integration","datePublished":"2022-08-19T15:28:00+00:00","mainEntityOfPage":{"@id":"https:\/\/wpengine.com\/blog\/wordpress-laravel\/"},"wordCount":1501,"publisher":{"@id":"https:\/\/wpengine.com\/#organization"},"image":{"@id":"https:\/\/wpengine.com\/blog\/wordpress-laravel\/#primaryimage"},"thumbnailUrl":"https:\/\/wpengine.com\/wp-content\/uploads\/2022\/08\/laravel-header.png","inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/wpengine.com\/blog\/wordpress-laravel\/","url":"https:\/\/wpengine.com\/blog\/wordpress-laravel\/","name":"How to Integrate WordPress & Laravel","isPartOf":{"@id":"https:\/\/wpengine.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/wpengine.com\/blog\/wordpress-laravel\/#primaryimage"},"image":{"@id":"https:\/\/wpengine.com\/blog\/wordpress-laravel\/#primaryimage"},"thumbnailUrl":"https:\/\/wpengine.com\/wp-content\/uploads\/2022\/08\/laravel-header.png","datePublished":"2022-08-19T15:28:00+00:00","description":"Want to integrate Laravel with WordPress? Figure out all the steps and code you need with our easy to follow guide!","breadcrumb":{"@id":"https:\/\/wpengine.com\/blog\/wordpress-laravel\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/wpengine.com\/blog\/wordpress-laravel\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/wpengine.com\/blog\/wordpress-laravel\/#primaryimage","url":"https:\/\/wpengine.com\/wp-content\/uploads\/2022\/08\/laravel-header.png","contentUrl":"https:\/\/wpengine.com\/wp-content\/uploads\/2022\/08\/laravel-header.png","caption":"PHP code. Laravel WordPress"},{"@type":"BreadcrumbList","@id":"https:\/\/wpengine.com\/blog\/wordpress-laravel\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/wpengine.com\/"},{"@type":"ListItem","position":2,"name":"Laravel And WordPress Integration"}]},{"@type":"WebSite","@id":"https:\/\/wpengine.com\/#website","url":"https:\/\/wpengine.com\/","name":"WP Engine\u00ae","description":"Managed Hosting for WordPress","publisher":{"@id":"https:\/\/wpengine.com\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/wpengine.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/wpengine.com\/#organization","name":"WP Engine","url":"https:\/\/wpengine.com\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/wpengine.com\/#\/schema\/logo\/image\/","url":"https:\/\/wpengine.com\/wp-content\/uploads\/2025\/09\/WPEngine_OGImage-1.webp","contentUrl":"https:\/\/wpengine.com\/wp-content\/uploads\/2025\/09\/WPEngine_OGImage-1.webp","width":1200,"height":630,"caption":"WP Engine"},"image":{"@id":"https:\/\/wpengine.com\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/wpengine\/","https:\/\/x.com\/wpengine","https:\/\/www.instagram.com\/wpengine\/","https:\/\/www.linkedin.com\/company\/wpengine\/","https:\/\/www.youtube.com\/channel\/UCJeAEAxX69v24CUBZ0WBYSg"]},{"@type":"Person","@id":"https:\/\/wpengine.com\/#\/schema\/person\/e317e5c0dfa4fca60914f6c1dfde2e0e","name":"Erin Myers","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/cd881e115bc28c81642ec61752db9981ece9ee8b4c81498a9b6276b9cdcaf5e6?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/cd881e115bc28c81642ec61752db9981ece9ee8b4c81498a9b6276b9cdcaf5e6?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/cd881e115bc28c81642ec61752db9981ece9ee8b4c81498a9b6276b9cdcaf5e6?s=96&d=mm&r=g","caption":"Erin Myers"},"url":"https:\/\/wpengine.com\/blog\/author\/erin-myers\/"}]}},"mediapress_workflow_parent_id":null,"_links":{"self":[{"href":"https:\/\/wpengine.com\/wp-json\/wp\/v2\/posts\/4262","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wpengine.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/wpengine.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/wpengine.com\/wp-json\/wp\/v2\/users\/15"}],"replies":[{"embeddable":true,"href":"https:\/\/wpengine.com\/wp-json\/wp\/v2\/comments?post=4262"}],"version-history":[{"count":0,"href":"https:\/\/wpengine.com\/wp-json\/wp\/v2\/posts\/4262\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/wpengine.com\/wp-json\/wp\/v2\/media\/2574"}],"wp:attachment":[{"href":"https:\/\/wpengine.com\/wp-json\/wp\/v2\/media?parent=4262"}],"wp:term":[{"taxonomy":"audience","embeddable":true,"href":"https:\/\/wpengine.com\/wp-json\/wp\/v2\/audience?post=4262"},{"taxonomy":"blog-category","embeddable":true,"href":"https:\/\/wpengine.com\/wp-json\/wp\/v2\/blog-category?post=4262"},{"taxonomy":"buyer-stage","embeddable":true,"href":"https:\/\/wpengine.com\/wp-json\/wp\/v2\/buyer-stage?post=4262"},{"taxonomy":"company-and-culture","embeddable":true,"href":"https:\/\/wpengine.com\/wp-json\/wp\/v2\/company-and-culture?post=4262"},{"taxonomy":"content-type","embeddable":true,"href":"https:\/\/wpengine.com\/wp-json\/wp\/v2\/content-type?post=4262"},{"taxonomy":"location","embeddable":true,"href":"https:\/\/wpengine.com\/wp-json\/wp\/v2\/location?post=4262"},{"taxonomy":"persona","embeddable":true,"href":"https:\/\/wpengine.com\/wp-json\/wp\/v2\/persona?post=4262"},{"taxonomy":"product","embeddable":true,"href":"https:\/\/wpengine.com\/wp-json\/wp\/v2\/product?post=4262"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/wpengine.com\/wp-json\/wp\/v2\/topic?post=4262"},{"taxonomy":"use-cases","embeddable":true,"href":"https:\/\/wpengine.com\/wp-json\/wp\/v2\/use-cases?post=4262"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}