Original image filename in dynamic pages.

Hi, I found out that Wix doesn’t put the original filename of images in dynamic pages. This can be a problem for SEO.

I have a gallery with 500 images and 500 different pages, but the original filename is the dynamic page’s background image filename; for all 500 photos!

How can I fix it?

I really appreciate any help you can provide.

Stefano

1 Like

Your 500-different pages are nothing else than DATA-ENTRIES inside your DATABASE.

Take a look onto your database, where you have stored all your data-entries.
You should be able to find some DB-FIELDS (at least one) which is greyed-out.

Inspect this greyed-out-DB-Field, maybe this tip already help you to find your solution.

(Maybe there’s a better solution then I’m going to suggest).

You have no control over the filename but you can use the alt attribute:
https://www.wix.com/velo/reference/$w/image/alt
If you set the alt attribute to be the original file name it should affect the SEO results.

You can add a new field (‘alt’) to your db collection and store there the original file name, and one the page loads - retrieve this value from the dynamic dataset and assign it to the image.

Now - if you don’t want to go over all the images, you can run a query on Media/Files - go over the site file, search if they exist in your dynamic page collection image field (based on fileURL) and if they do - update the alt field based on the originalFileName value (from the Media/Files results):
https://www.wix.com/velo/reference/wix-media-backend/%22files%22-collection-fields

1 Like

Yes, thanks a lot, J.D.

I’ve already set up the ALT attribute with a short description of each photograph (I have a dedicated field in the database).

But I had read that the original filename was also crucial for SEO.

I hope I’m wrong.

Stefano

1 Like

There is a way to use the alt description as file name using http functions (I don’t know if its recommended though).

Something like: have a link like:
https://my-doamin.com/_functions/image/blue-bird.jpg;

Now in your backend/http-functions
You can have a get_image function that takes the path with the file name, query the database and serve the image.

(I don’t think I’d use it due to performance reasons. But for your consideration).

1 Like

Thanks a lot, J.D.,

I’ll study it and do some tests.

Stefano