skip to Main Content

For a larger amount of images (approx 1k, plus same amount of thumbs, in ca 500 folders), we have the requirement that all image URIs used on the site have to have a SEO optimized path. They are already prepared and present with the complete path structures (each folder contains a thumbs folder with the same filename with smaller size/dimensions).

These are the URIs that we want to achieve:

Full size Image URI: http://myserver.com/img/de/cats/brown/jimmy.jpg

Thumb Image URI: http://myserver.com/img/de/cats/brown/thumbs/jimmy.jpg

  • They shall have an additional path, e.g. de/cats/brown in the examples above
  • They should start on the root of the domain, i.e. without the wp-content/uploads/ part of standard wordpress media files.

Simply put: we need full control over the image URIs, i.e. to have their own ‘SEO-able’ path structure and permalink.

I checked out several Gallery plugins (paid and free) but could not find any documentation on them for the above requirement.

Do you know of any plugin/theme to achieve and manage the URI structure described above?

2

Answers


  1. You can try to add these lines by placing them inside your functions.php file:

    update_option('upload_url_path', '/wp-content/uploads');
    

    This will make WordPress embed images like:

    src="/wp-content/uploads/fileName.jpg" 
    

    instead of

    src="http://domainName.com/wp-content/uploads/fileName.jpg"
    

    I hope this can help you to solve your problem.

    Login or Signup to reply.
  2. if you need to change default media upload location,you need to edit the wp-config.php file located in the root directory of your WordPress installation.

    define( 'UPLOADS', 'wp-content/'.'Your Folder Name' );
    

    Remember you can still choose whether or not you want uploaded files to be organized in month/year folders in Settings » Media.

    Note: Write this code before this line in wp-config.php

    require_once(ABSPATH . 'wp-settings.php');
    

    Hope it may help you

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search