Sửa lỗi mất url ảnh khi chuyển tên miền mới cho WordPress

Đánh giá post

Đã có rất nhiều bạn hỏi tôi về vấn đề cập nhật chuyển tên miền hoặc thay đổi link của một Website sử dụng WordPress. Nó ảnh hưởng rất lớn đến SEO nếu như bạn không làm việc này một cách đúng và kịp thời. Trong bài viết này tôi sẽ hướng dẫn các bạn các trường hợp các bạn đang gặp nếu như không muốn ảnh hưởng về kết quả của SEO bằng việc cập nhật ngay URLs khi thay đổi link hoặc chuyển sang 1 tên miền mới. Bạn sẽ cần trong các trường hợp sau:
Chuyển từ HTTP sang HTTPS
Đổi từ tên miền A sang tên miền B
Đổi link ví dụ từ www.domain.com/link-cũ sang www.domain.com/link-mới
Thay đổi dữ liệu cả toàn trang từ nội dung A sang nội dung B

Nội dung bài viết này tôi sẽ hướng dẫn bằng việc sử dụng chạy lệnh trên phpmyadmin và từ console của VPS. Nếu bạn muốn sử dụng Plugins để thực hiện thì tham khảo bài viết này: Chuyển từ HTTP sang HTTPS không lo mất SEO.
Cập nhật cơ sở dữ liệu WordPress

Trước khi thực hiện, tôi khuyên bạn nên backup 1 bản dữ liệu để đề phòng nếu bạn không cảm thấy tự tin mình sẽ làm chính xác hoặc nếu có xảy ra sai sót 1 gì đó.

Vào SQL của cỡ sở dữ liệu mà bạn muốn cập nhật, chạy một số cập nhật sql và các lệnh thay thế trên các bảng đáng, wp_options, wp_posts, wp_postmeta. Đây cũng là các bảng có chứa nội dung, url cần thay thế.

Sử dụng mã như dưới đây và hoán đổi trong URL cũ và mới của bạn, không có dấu gạch dưới. Ngoài ra nếu cần thiết thay đổi các giá trị tiền tố bảng nếu áp dụng (tức là wp_ là mặc định của WordPress khi cài đặt, nhưng nhiều bạn chỉnh thành khác thì hãy chú ý thay nó ở lệnh dưới đây)

phpmyadmin chay lenh sql
UPDATE wp_options SET option_value = replace(option_value, 'http://www.URLcũ', 'http://www.URLmới') WHERE option_name = 'home' OR option_name = 'siteurl';
UPDATE wp_posts SET guid = replace(guid, 'http://www.URLcũ','http://www.URLmới');
UPDATE wp_posts SET post_content = replace(post_content, 'http://www.URLcũ', 'http://www.URLmới');
UPDATE wp_postmeta SET meta_value = replace(meta_value,'http://www.URLcũ','http://www.URLmới');
Đánh giá post


  1. c88 login

    1. C88 Fun – Boundless Entertainment Awaits!
    C88 Fun is more than a gaming platform; it’s an expedition waiting to be embraced. Featuring an intuitive interface and a diverse array of games, C88 Fun caters to all tastes. From timeless classics to cutting-edge releases, C88 Fun ensures every player discovers their gaming haven.

    2. JILI & Evo 100% Welcome Bonus – A Grand Welcome Awaits Newcomers!
    Embark on your gaming journey with a grand welcome from C88. New members are greeted with a 100% Welcome Bonus from JILI & Evo, doubling the excitement right from the beginning. This bonus acts as a catalyst for players to explore the diverse array of games available on the platform.

    3. C88 First Deposit Get 2X Bonus – Double the Excitement!
    At C88, generosity towards players is a fundamental principle. With the “First Deposit Get 2X Bonus” offer, players can revel in double the fun on their initial deposit. This promotion enhances the gaming experience, providing more avenues to win big across various games.

    4. 20 Spin Times = Get Big Bonus (8,888P) – Spin Your Way to Greatness!
    Spin your way to substantial bonuses with the “20 Spin Times” promotion. Accumulate spins and stand a chance to win an impressive bonus of 8,888P. This promotion adds an extra layer of excitement to the gameplay, combining luck and strategy for maximum enjoyment.

    5. Daily Check-in = Turnover 5X?! – Daily Rewards Await!
    Consistency is paramount at C88. By simply logging in daily, players not only bask in the thrill of gaming but also stand a chance to multiply their turnovers by 5X. Daily check-ins bring additional perks, making every day a rewarding experience for dedicated players.

    6. 7 Day Deposit 300 = Get 1,500P – Unlock Deposit Rewards!
    For those eager to seize opportunities, the “7 Day Deposit” promotion is a game-changer. Deposit 300 and receive a generous reward of 1,500P. This promotion encourages players to explore the platform further and maximize their gaming potential.

    7. Invite 100 Users = Get 10,000 PESO – Share the Excitement!
    C88 believes in the strength of community. Invite friends and fellow gamers to join the excitement, and for every 100 users, receive an incredible reward of 10,000 PESO. Sharing the joy of gaming has never been more rewarding.

    8. C88 New Member Get 100% First Deposit Bonus – Exclusive Benefits!
    New members are in for a treat with an exclusive 100% First Deposit Bonus. C88 ensures that everyone kicks off their gaming journey with a boost, setting the stage for an exhilarating experience filled with opportunities to win.

    9. All Pass Get C88 Extra Big Bonus 1000 PESO – Unlock Unlimited Rewards!
    For avid players exploring every nook and cranny of C88, the “All Pass Get C88 Extra Big Bonus” offers an additional 1000 PESO. This promotion rewards those who embrace the full spectrum of games and features available on the platform.

    Ready to immerse yourself in the excitement? Visit C88 now and unlock a world of gaming like never before. Don’t miss out on the excitement, bonuses, and wins that await you at C88. Join the community today, and let the games begin! #c88 #c88login #c88bet #c88bonus #c88win

Trả lời

Email của bạn sẽ không được hiển thị công khai.