Viewing 12 replies - 1 through 12 (of 12 total)
  • It’s ok if your table names are different; in fact it’s recommended for security.

    So you can use that sql command you showed but what wp_posts to wp_gczrwa9rkw_posts etc

    Thread Starter zerolizer0

    (@zerolizer0)

    Thank you pxforti.

    I changed wp_posts to wp_gczrwa9rkw_posts and did the update. After some syntax errors I managed to get it right. But since the old and new URL is the same it didn’t make any difference. “0 rows affected”. So, I still have double links and missing pictures. Is there something else I can do?

    The reason your images aren’t showing is this:

    <img src=”http:liberatingthespirit.com

    use the same sql command to change it:

    search for this: <img src=”http:liberatingthespirit.com

    replace it with this: <img src=”https://liberatingthespirit.com

    RE the double url. First find the link in your code where the double url occurs;
    eg https://www.liberatingthespirit.com/www.liberatingthespirit.com/

    Whatever that is, you’ll have to do the same sql search and replace. Using the example above:

    search for https://www.liberatingthespirit.com/www.liberatingthespirit.com/

    replace with https://www.liberatingthespirit.com/

    Of course, don’t use my example; use the double link code on your site. I looked over some links on your site but didn’t see any double urls. If you can send me the url of a page that has double links, send it to me along with the link text. Then I can provide the exact search and replace text.

    Thread Starter zerolizer0

    (@zerolizer0)

    I can’t get any of those searches to work.

    Assuming this is correct: UPDATE wp_gczrwa9rkw_posts SET post_content=(REPLACE (post_content, ‘<img src=”http:liberatingthespirit.com’,'<img src=”https://liberatingthespirit.com’));

    It just says: #1064 –

    I’ve also tried to run various searches and I never get any result from liberatingthespirit, but I do get results if I just search for liberating. I’ve searched in both links and posts.

    So, apparently I’m doing something wrong.

    I thought I saw more than one double link but I can only find one right now, here https://liberatingthespirit.com/samsung-galaxy-note-8-inch-tablet-review/
    (stolen in Tanzania)
    I suppose it could have been a mistake on my part when I wrote the post and that it wasn’t because of the migration.

    Thread Starter zerolizer0

    (@zerolizer0)

    I could really use some help with this still. Could someone tell me why I get an error with this code: (REPLACE (post_content, ‘<img src=”http:liberatingthespirit.com’,'<img src=”https://liberatingthespirit.com’));

    Thank you.

    You need to use the complete command:

    UPDATE wp_posts SET post_content=(REPLACE (post_content, ‘<old url>’,'<new url>’));

    Thread Starter zerolizer0

    (@zerolizer0)

    Now I get another error.

    #1054 – Unknown column ‘a€?liberatingthespirit.coma€?’ in ‘field list’

    I used this command: UPDATE wp_gczrwa9rkw_posts SET post_content=(REPLACE (post_content, ‘liberatingthespirit.com’,’liberatingthespirit.com’));

    What does that mean?

    It looks like you’re getting unknown characters in there. Better if you copy and past the code to a text editor first. If that doesn’t work, I recommend that you use this script to search and replace.

    https://interconnectit.com/products/search-and-replace-for-wordpress-databases/

    Make sure you select the correct tables to search in the table list

    Thread Starter zerolizer0

    (@zerolizer0)

    Thank you. That worked.
    However, it didn’t affect anything. “0 rows affected”.

    Is that because the url is the same? And if so how do I get around that?

    Originally, you were looking for images that were broken. Once reason they were broken is because the http: was missing //

    eg: below.

    search for this: <img src=”http:liberatingthespirit.com

    replace it with this: <img src=”https://liberatingthespirit.com

    In the case of the double urls: https://www.liberatingthespirit.com/blablawww.liberatingthespirit.com/blabla

    You’d need to search for liberatingthespirit.com/blablawww.liberatingthespirit.com/blabla

    and replace with liberatingthespirit.com/blabla

    Or something like that. You have to look at the page code where you are having issues and see what it is you want to change.

    Thread Starter zerolizer0

    (@zerolizer0)

    Thank you pxforti.

    I think the double url must have been a mistake on my part I somehow made when I wrote the post. So I just fixed the one I’ve found.

    When I search for http:liberatingthespirit.com (without the //) then there are 713 results.

    But when I run this command UPDATE wp_gczrwa9rkw_posts SET post_content=(REPLACE (post_content, ‘<img src=”http:liberatingthespirit.com’,'<img src=”https://liberatingthespirit.com’)); 0 rows are affected.

    What am I still doing wrong?

Viewing 12 replies - 1 through 12 (of 12 total)
  • The topic ‘Double URL and broken links’ is closed to new replies.