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

mojemoron's avatar

How to integrate wordpress into laravel application

Hello, I am new to laravel. I just built a laravel app and I want to manage only the blog section with wordpress. How can this be achieved? Thanks

0 likes
11 replies
Romain's avatar

How many users will your app have? If only you, I guess they can be two different applications. If many hundreds then you'll have a bit of a problem.

How do you imagine this working? What would be a workflow of a user posting?

mojemoron's avatar

@Romain I could also build the blog cms with laravel but considering time and all the lovely features that wordpress have. I don't want to repeat myself.

Romain's avatar

Then for only 3 users I wouldn't bother "integrating" WP and Laravel together. Just get your 3 users to login for your Laravel app AND for WP separately.

Just make sure the designs on both app work and you're good to go.

Romain's avatar

Simply with a link to your wordpress install. Maybe you can even do a subdomain.

What link do you expect your WP installation to respond to?

1 like
mojemoron's avatar

@Romain tnz. installation worked, but is it possible to query my wordpress post in my laravel app. For example I want to display recent posts on my footer and sidebar on my laravel app

ShaneTurner's avatar

I believe WordPress has a plugin that exposes an API that you could then use to access your post data. Or if they're hosted on the same machine, directly access the WordPress database.

P.S. I only know that these features exist from talking to my colleagues. I don't use wordpress.

2 likes
Tulev's avatar

It will be really useful if you could share the way you solved that issue @mojemoron

raush's avatar

put the Wordpress Blog in the 'public' folder of your Laravel app.

i.e. .../laravel_app/public/wordpress_blog

or simply: laravel_app/public/blog

now, you can access the blog as https://www.your-site.com/blog https://www.your-site.com/blog/wp_admin

no need to worry about the routes in laravel, it will work just fine.

You can even use the same database for both, just use a prefix for the wordpress tables e.g. 'wp_sometable'. you can set a prefix during wordpress installation. So you have a single database for both Laravel & Wordpress tables.

if you want to get wordpress posts from laravel for whatever reason, you can use: https://github.com/jgrossi/corcel or https://github.com/tareq1988/wp-eloquent

1 like

Please or to participate in this conversation.