![]() |
![]() |
![]() |
||||
Welcome to the GoFuckYourself.com - Adult Webmaster Forum forums. You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today! If you have any problems with the registration process or your account login, please contact us. |
![]() ![]() |
|
Discuss what's fucking going on, and which programs are best and worst. One-time "program" announcements from "established" webmasters are allowed. |
|
Thread Tools |
![]() |
#1 |
Confirmed User
Industry Role:
Join Date: Apr 2007
Posts: 5,169
|
Mass conversion of images - Wordpress
Hi. Did anyone already have a need to convert all existing photos on the website from jpg to WEBP or AVIF format?
The site is on WP and there are a few thousand blogs posts which means a lot of images. I know there are plugins like Webp converter for media, but what worries me is that it will do redirects instead of really replacing images in posts. On top of that, there are many nextgen galleries too. thanks
__________________
Femdom Destiny -------------------------------------------- ICQ: 463-630-426 email: webmaster(at)femdomdestiny.com |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#2 |
Too lazy to set a custom title
Join Date: Jan 2003
Location: Los Angeles
Posts: 10,540
|
What is the need for conversion?
Once you have the new image files, a search and replace string should prevent redirects, but sounds like a hassle. https://wordpress.org/plugins/better-search-replace/ Plus a lot of stuff doesn’t play well with those formats. |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#3 |
Confirmed User
Industry Role:
Join Date: Sep 2013
Location: The Netherlands
Posts: 805
|
True, webp isn't fully supported on all devices yet... So you should use the <picture> tag and let the browser decide which format to display.
<picture> <source srcset="boobies.webp" type="image/webp"> <source srcset="boobies.jpg" type="image/jpeg"> <img src='boobies.jpg'> </picture> An option would be to use the free Windows tool Xnconvert, download all your site's jpg files to your pc, convert them all with Xnconvert, then reupload those webp files. PHP can convert jpg images in 3 or 4 lines of code, using ImageCreateFromString and store the webp file with imagewebp. Just include it in the upload form so it's automated. You can probably hire someone of Fiverr to do that for you for a few bucks, as it probably takes 10 minutes or so to get it fixed. |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#4 |
Confirmed User
Industry Role:
Join Date: Jan 2022
Location: Europe
Posts: 105
|
I use "WebP Converter for Media" and it works perfectly. It also detects browsers that do not support Webp or AVIF images and shows them JPEG or PNG images. Try it.
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#5 | |
Confirmed User
Industry Role:
Join Date: Apr 2007
Posts: 5,169
|
Quote:
I think it will eventually become mandatory. Actually,I think I am late at least for this site I am improving now. Problem is how to automatically replace paths to new files without spending months
__________________
Femdom Destiny -------------------------------------------- ICQ: 463-630-426 email: webmaster(at)femdomdestiny.com |
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#6 | |
Confirmed User
Industry Role:
Join Date: Sep 2013
Location: The Netherlands
Posts: 805
|
Quote:
I don't use WP so I wouldn't know for sure, but my guess is that Wordpress uses its own custom php function for showing images inside a blog post. Meaning, you would only need to change a line or two in the source code to apply that change (to also include webp images) in all blog posts, instead of manually changing thousand blog posts. But again, I'm not a Wordpress expert, but I guess such thing would be the case. Does Wordpress store posts inside the database using some sort of markdown? If that's the case, it's 100% certain there's some function inside the source code that takes care of the markdown parsing of the images. |
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#7 | |
So fuckin' bored
Industry Role:
Join Date: Jun 2003
Posts: 32,382
|
![]() Quote:
![]() 1) If you want to automatically convert images in new posts, just put the following code into the Expert -> Custom PHP code box in your feed settings: Code:
if (!cseo_post_exists($post)) { preg_match_all('/<img.+?src=["\'](.+?)["\'].*?>/is', $post['post_content'] . $post['post_excerpt'], $matches); if (isset($matches[1])) { foreach ($matches[1] as $link) { cseo_store_image($link, $post['post_title'], -1, -1, -1, IMAGETYPE_WEBP); } } } else { $post = false; } 2) If you want to do the same trick with images in already existing posts, click Post Modification Tools, put the following code into the box and execute it: Code:
preg_match_all('/<img.+?src=["\'](.+?)["\'].*?>/is', $post->post_content . $post->post_excerpt, $matches); if (isset($matches[1])) { foreach ($matches[1] as $link) { $new_link = cseo_save_image($link, $post->post_title, -1, -1, -1, IMAGETYPE_WEBP); if ($new_link != $link) { $post->post_content = str_replace($link, $new_link, $post->post_content); $post->post_excerpt = str_replace($link, $new_link, $post->post_excerpt); cseo_delete_media_by_url(array($link)); } } } ![]() If you want to convert your images into a different format, simply replace IMAGETYPE_WEBP with the appropriate value, e.g.: IMAGETYPE_JPEG, IMAGETYPE_PNG etc. Find more examples for Modification Tools here: https://www.cyberseo.net/modification-tools/#examples P.S. Make sure you are using the most recent version of CyberSEO Pro, which is 9.016 ATM.
__________________
Obey the Cowgod |
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#8 |
Affiliate-Programs.Biz
Industry Role:
Join Date: Oct 2016
Posts: 16,041
|
https://image.online-convert.com/convert/gif-to-webp
supports mass conversion, also from Dropbox and Google Drive
__________________
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#9 | |
Confirmed User
Industry Role:
Join Date: Apr 2007
Posts: 5,169
|
Quote:
__________________
Femdom Destiny -------------------------------------------- ICQ: 463-630-426 email: webmaster(at)femdomdestiny.com |
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#10 | |
So fuckin' bored
Industry Role:
Join Date: Jun 2003
Posts: 32,382
|
Quote:
You can do it here for 50% of the base price: https://www.cyberseo.net/upgrade/
__________________
Obey the Cowgod |
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#11 |
Making PHP work
Industry Role:
Join Date: Nov 2002
Location: 🌎🌅🌈🌇
Posts: 20,294
|
The internet 1998 : Wow, I'm free!!
The internet today : I'm a slave of Google artificial intelligence. ![]()
__________________
Make Money with Porn |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#12 |
Confirmed User
Industry Role:
Join Date: Apr 2007
Posts: 5,169
|
Thanks to all people answering above.
Hosting support did the whole job for me.
__________________
Femdom Destiny -------------------------------------------- ICQ: 463-630-426 email: webmaster(at)femdomdestiny.com |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#13 |
Too lazy to set a custom title
Join Date: Jan 2003
Location: Los Angeles
Posts: 10,540
|
So sadly true
__________________
![]() ![]() ![]() ![]() ![]() Blue Blood's SpookyCash.com Babe photography portfolio |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#14 |
Confirmed User
Industry Role:
Join Date: Apr 2007
Posts: 5,169
|
Hm..I've noticed a drop in traffic after replacing jpegs with WEBP. At the moment I am not sure is it the result of changing WordPress theme or traffic loss coming from google images searches.
So I am now trying to see the number of searches coming from google images. I am using analytics and trying with source/medium section but there are no results. Any Idea how to filter and see only google images traffic?
__________________
Femdom Destiny -------------------------------------------- ICQ: 463-630-426 email: webmaster(at)femdomdestiny.com |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#15 | |
Confirmed User
Industry Role:
Join Date: Sep 2013
Location: The Netherlands
Posts: 805
|
Quote:
But if they are no longer indexed, did you literally replaced the jpg's for webp files only, rather then setting multiple formats with the <picture> tag? Otherwise, I don't see what could cause the de-indexing to happen. |
|
![]() |
![]() ![]() ![]() ![]() ![]() |