Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!


New on LowEndTalk? Please Register and read our Community Rules.

All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.

WordPress - MySQL - replace domain for all pdf links in database.

Hello there,

We have a website with a huge number of PDF documents.

All PDFs are moved to a new location (v2.domain.com ) and everything else stays at the original location (domain.com).

How can I update the database to change the domain for all links that contain PDF?

domain.compdf replace with v2.domain.compdf?

We use Ubuntu, I have key help with phpmyadmin.

Is it better to do it via some plugin or via MySQL query?
Can you please help me with query?

I have tried:

UPDATE wp_posts
SET post_content = REPLACE(post_content, 'http://domain.com', 'http://v2.domain.com')
WHERE post_content LIKE '%.pdf%';

Regards

Comments

Sign In or Register to comment.