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.

Post New Thread Reply

Register GFY Rules Calendar
Go Back   GoFuckYourself.com - Adult Webmaster Forum > >
Discuss what's fucking going on, and which programs are best and worst. One-time "program" announcements from "established" webmasters are allowed.

 
Thread Tools
Old 04-17-2022, 06:36 PM   #1
femdomdestiny
Confirmed User
 
femdomdestiny's Avatar
 
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
femdomdestiny is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 04-17-2022, 11:25 PM   #2
AmeliaG
Too lazy to set a custom title
 
AmeliaG's Avatar
 
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.
AmeliaG is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 04-18-2022, 02:15 AM   #3
zijlstravideo
Confirmed User
 
zijlstravideo's Avatar
 
Industry Role:
Join Date: Sep 2013
Location: The Netherlands
Posts: 805
Quote:
Originally Posted by AmeliaG View Post
Plus a lot of stuff doesn’t play well with those formats.
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.
__________________
Contact: email
zijlstravideo is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 04-18-2022, 04:05 AM   #4
Theblowjobplace
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.
Theblowjobplace is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 04-18-2022, 05:55 AM   #5
femdomdestiny
Confirmed User
 
femdomdestiny's Avatar
 
Industry Role:
Join Date: Apr 2007
Posts: 5,169
Quote:
Originally Posted by AmeliaG View Post
What is the need for conversion?

Plus a lot of stuff doesn’t play well with those formats.
Need is a speed optimization for SEO purposes. Reducing image size is one of the steps.

Quote:
Originally Posted by zijlstravideo View Post
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.
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
femdomdestiny is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 04-18-2022, 07:02 AM   #6
zijlstravideo
Confirmed User
 
zijlstravideo's Avatar
 
Industry Role:
Join Date: Sep 2013
Location: The Netherlands
Posts: 805
Quote:
Originally Posted by femdomdestiny View Post
Problem is how to automatically replace paths to new files without spending months
I see...

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.
__________________
Contact: email
zijlstravideo is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 04-18-2022, 08:40 AM   #7
just a punk
So fuckin' bored
 
just a punk's Avatar
 
Industry Role:
Join Date: Jun 2003
Posts: 32,382

Quote:
Originally Posted by femdomdestiny View Post
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
If you have a CyberSEO Pro license (since you are a GFY member, I assume you have it ) then you already have all the tools you need. Here we go:

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;
}
Now the plugin will automatically convert post images into the WEBP format.

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));
        }
    }
}
Vualá! All your WordPress post images now converted into WEBM

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
just a punk is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 04-18-2022, 09:17 AM   #8
kuprum
Affiliate-Programs.Biz
 
kuprum's Avatar
 
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
kuprum is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 04-18-2022, 10:10 AM   #9
femdomdestiny
Confirmed User
 
femdomdestiny's Avatar
 
Industry Role:
Join Date: Apr 2007
Posts: 5,169
Quote:
Originally Posted by CyberSEO View Post
If you have a CyberSEO Pro license (since you are a GFY member, I assume you have it ) then you already have all the tools you need. Here we go:

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;
}
Now the plugin will automatically convert post images into the WEBP format.

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));
        }
    }
}
Vualá! All your WordPress post images now converted into WEBM

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.
Damn., I've purchased the plugin in 2012! and never tried it. Will take a look later, hosting is working on doing all this for me.thanks
__________________
Femdom Destiny


--------------------------------------------
ICQ: 463-630-426
email: webmaster(at)femdomdestiny.com
femdomdestiny is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 04-18-2022, 10:55 AM   #10
just a punk
So fuckin' bored
 
just a punk's Avatar
 
Industry Role:
Join Date: Jun 2003
Posts: 32,382
Quote:
Originally Posted by femdomdestiny View Post
Damn., I've purchased the plugin in 2012! and never tried it. Will take a look later, hosting is working on doing all this for me.thanks
Unfortunately the version of 2012 is too old to do these things. You will need to prolong your license to receive the plugin updates during a year.

You can do it here for 50% of the base price: https://www.cyberseo.net/upgrade/
__________________
Obey the Cowgod
just a punk is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 04-18-2022, 11:19 AM   #11
blackmonsters
Making PHP work
 
blackmonsters's Avatar
 
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
blackmonsters is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 04-19-2022, 10:32 AM   #12
femdomdestiny
Confirmed User
 
femdomdestiny's Avatar
 
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
femdomdestiny is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 04-19-2022, 11:42 AM   #13
AmeliaG
Too lazy to set a custom title
 
AmeliaG's Avatar
 
Join Date: Jan 2003
Location: Los Angeles
Posts: 10,540
Quote:
Originally Posted by blackmonsters View Post
The internet 1998 : Wow, I'm free!!

The internet today : I'm a slave of Google artificial intelligence.

So sadly true
__________________
GFY Hall of Famer

AltStar Hall of Famer




Blue Blood's SpookyCash.com

Babe photography portfolio
AmeliaG is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 04-23-2022, 12:53 PM   #14
femdomdestiny
Confirmed User
 
femdomdestiny's Avatar
 
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
femdomdestiny is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 04-23-2022, 01:18 PM   #15
zijlstravideo
Confirmed User
 
zijlstravideo's Avatar
 
Industry Role:
Join Date: Sep 2013
Location: The Netherlands
Posts: 805
Quote:
Originally Posted by femdomdestiny View Post
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?
Not sure exactly... But you can do a quick search on Google images yourself to see if they are still indexed. Use the query: site:yourdomain.com

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.
__________________
Contact: email
zijlstravideo is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Post New Thread Reply
Go Back   GoFuckYourself.com - Adult Webmaster Forum > >

Bookmarks

Tags
images, webp, posts, worries, plugins, media, converter, top, nextgen, galleries, replacing, lot, redirects, blogs, convert, existing, photos, website, jpg, mass, thousand, wordpress, conversion, avif, format



Advertising inquiries - marketing at gfy dot com

Contact Admin - Advertise - GFY Rules - Top

©2000-, AI Media Network Inc



Powered by vBulletin
Copyright © 2000- Jelsoft Enterprises Limited.