Skip to main content
deleted 6 characters in body
Source Link
sound wave
  • 215
  • 1
  • 3
  • 15

Replace a character in all post titles and slugs

I have hundreds of posts whose titles are of the form XmY, where X and Y are natural numbers, for example 18m324.

I'd like to replace m with p in all post titles and slugs, while keeping X and Y unchanged. How to do it in phpmyadmin? This is what I got so far

UPDATE wp_posts
SET post_title = 
REPLACE(post_title, 'm' , 'p')
WHERE post_type = 'post' AND post_status = 'publish';

This code should replace in the titles, but what about the slugs?

Replace a character in all post titles

I have hundreds of posts whose titles are of the form XmY, where X and Y are natural numbers, for example 18m324.

I'd like to replace m with p in all post titles, while keeping X and Y unchanged. How to do it in phpmyadmin? This is what I got so far

UPDATE wp_posts
SET post_title = 
REPLACE(post_title, 'm' , 'p')
WHERE post_type = 'post' AND post_status = 'publish';

Replace a character in all post titles and slugs

I have hundreds of posts whose titles are of the form XmY, where X and Y are natural numbers, for example 18m324.

I'd like to replace m with p in all post titles and slugs, while keeping X and Y unchanged. How to do it in phpmyadmin?

UPDATE wp_posts
SET post_title = 
REPLACE(post_title, 'm' , 'p')
WHERE post_type = 'post' AND post_status = 'publish';

This code should replace in the titles, but what about the slugs?

deleted 6 characters in body
Source Link
sound wave
  • 215
  • 1
  • 3
  • 15

I have hundreds of posts whose titles are of the form XmY, where X and Y are natural numbers, for example 18m324.

I'd like to replace m with p in all post titles, while keeping X and Y unchanged. How to do it in phpmyadmin? This is what I got so far

UPDATE 'wp_posts'wp_posts
SET 'post_title'post_title = 
REPLACE('post_title'post_title, 'm' , 'p')
WHERE post_type = 'post' AND post_status = 'publish';

I have hundreds of posts whose titles are of the form XmY, where X and Y are natural numbers, for example 18m324.

I'd like to replace m with p in all post titles, while keeping X and Y unchanged. How to do it in phpmyadmin? This is what I got so far

UPDATE 'wp_posts'
SET 'post_title' = 
REPLACE('post_title', 'm' , 'p')
WHERE post_type = 'post' AND post_status = 'publish';

I have hundreds of posts whose titles are of the form XmY, where X and Y are natural numbers, for example 18m324.

I'd like to replace m with p in all post titles, while keeping X and Y unchanged. How to do it in phpmyadmin? This is what I got so far

UPDATE wp_posts
SET post_title = 
REPLACE(post_title, 'm' , 'p')
WHERE post_type = 'post' AND post_status = 'publish';
Source Link
sound wave
  • 215
  • 1
  • 3
  • 15

Replace a character in all post titles

I have hundreds of posts whose titles are of the form XmY, where X and Y are natural numbers, for example 18m324.

I'd like to replace m with p in all post titles, while keeping X and Y unchanged. How to do it in phpmyadmin? This is what I got so far

UPDATE 'wp_posts'
SET 'post_title' = 
REPLACE('post_title', 'm' , 'p')
WHERE post_type = 'post' AND post_status = 'publish';