Title: Exclude folder on different domain sharing same database
Last modified: February 2, 2024

---

# Exclude folder on different domain sharing same database

 *  Resolved [suryamaya](https://wordpress.org/support/users/suryamaya/)
 * (@suryamaya)
 * [2 years, 3 months ago](https://wordpress.org/support/topic/exclude-folder-on-different-domain-sharing-same-database/)
 * Hi there,
 * We have website abc.com and there another few sites (mysite1.com, mysite2.com)
   that share the same database as abc.com. When I activated the plugin it works
   on abc.com but not on mysite1.com, mysite2.com. All the sites are on the same
   hosting and within the same account.
 * I tried “webpc_supported_source_directory” filter adding the directory where 
   those sites are. abc.com is in public_html and other sites are in different directory
   say mysite1 and mysite2. But the filter didn’t work. Is there a way to exclude
   the images of mysite1.com and mysite2.com?
   Thanks

Viewing 15 replies - 1 through 15 (of 17 total)

1 [2](https://wordpress.org/support/topic/exclude-folder-on-different-domain-sharing-same-database/page/2/?output_format=md)
[→](https://wordpress.org/support/topic/exclude-folder-on-different-domain-sharing-same-database/page/2/?output_format=md)

 *  Plugin Author [Mateusz Gbiorczyk](https://wordpress.org/support/users/mateuszgbiorczyk/)
 * (@mateuszgbiorczyk)
 * [2 years, 3 months ago](https://wordpress.org/support/topic/exclude-folder-on-different-domain-sharing-same-database/#post-17392919)
 * Hi [@suryamaya](https://wordpress.org/support/users/suryamaya/),
 * Thank you for your message.
 * Please provide an example of the path you would like to exclude and an example
   of the path from which you would like to convert images.
 * Best,
    Mateusz
 *  Thread Starter [suryamaya](https://wordpress.org/support/users/suryamaya/)
 * (@suryamaya)
 * [2 years, 3 months ago](https://wordpress.org/support/topic/exclude-folder-on-different-domain-sharing-same-database/#post-17397814)
 * Thank you [@mateuszgbiorczyk](https://wordpress.org/support/users/mateuszgbiorczyk/)
   for your response.
 * When I enabled the plugin it only works for main site “abc.com” but not for other
   sites”mysite1.com, mysite2.com”. Please be advised that the same database is 
   shared between all three sites. Basically if webP works for other two sites “
   mysite1.com, mysite2.com” that would be great. Please advise if that is possible.
   
   However if that is not possible the folders that I would like to exclude are 
   as listed below:1. public_html/mysite1/wp-content/uploads2. public_html/mysite2/
   wp-content/uploadsThanks
 *  Plugin Author [Mateusz Gbiorczyk](https://wordpress.org/support/users/mateuszgbiorczyk/)
 * (@mateuszgbiorczyk)
 * [2 years, 3 months ago](https://wordpress.org/support/topic/exclude-folder-on-different-domain-sharing-same-database/#post-17398070)
 * [@suryamaya](https://wordpress.org/support/users/suryamaya/) By default, in the
   case of WordPress Multisite, we have the same directory for all sites. We have
   one /wp-content directory and one WordPress root directory.
 * However, in the /wp-content/uploads/ directory we are divided into directories
   for different sites. That’s why I asked you to provide real paths, not examples.
 *  Thread Starter [suryamaya](https://wordpress.org/support/users/suryamaya/)
 * (@suryamaya)
 * [2 years, 3 months ago](https://wordpress.org/support/topic/exclude-folder-on-different-domain-sharing-same-database/#post-17407752)
 * Hi [@mateuszgbiorczyk](https://wordpress.org/support/users/mateuszgbiorczyk/)
 * Here are site links:
   Main site: [https://cruise-croatia.com.au/](https://cruise-croatia.com.au/)
   Sites that share the same database: [https://cruise-croatia-and-beyond.co.nz/](https://cruise-croatia-and-beyond.co.nz/)
   [https://cruise-croatia-and-beyond.co.uk/](https://cruise-croatia-and-beyond.co.uk/)
   Does this help?
 *  Plugin Author [Mateusz Gbiorczyk](https://wordpress.org/support/users/mateuszgbiorczyk/)
 * (@mateuszgbiorczyk)
 * [2 years, 3 months ago](https://wordpress.org/support/topic/exclude-folder-on-different-domain-sharing-same-database/#post-17408883)
 * [@suryamaya](https://wordpress.org/support/users/suryamaya/) Our plugin is compatible
   with WordPress Multisite, but in my opinion this is not a Multisite Network. 
   By default, image URLs at Multisite have the following URL:
    `/wp-content/uploads/
   sites/1/2024/04/example-image.png`
 * Your URLs look like this:
    `/wp-content/uploads/2024/04/example-image.png`
 * Please describe to me in detail how your websites are connected to each other
   from a technical point of view. It’s very important that I can help you.
 *  Thread Starter [suryamaya](https://wordpress.org/support/users/suryamaya/)
 * (@suryamaya)
 * [2 years, 3 months ago](https://wordpress.org/support/topic/exclude-folder-on-different-domain-sharing-same-database/#post-17411037)
 * Hi [@mateuszgbiorczyk](https://wordpress.org/support/users/mateuszgbiorczyk/)
 * This is not the multisite as you said. The two of the later sites share the database
   from the main site. The NZ an UK sites are in one folder and main site in one
   folder. Hope this helps.
   Please let me know if you have any questions.
 *  Plugin Author [Mateusz Gbiorczyk](https://wordpress.org/support/users/mateuszgbiorczyk/)
 * (@mateuszgbiorczyk)
 * [2 years, 3 months ago](https://wordpress.org/support/topic/exclude-folder-on-different-domain-sharing-same-database/#post-17411039)
 * [@suryamaya](https://wordpress.org/support/users/suryamaya/) How is it structured
   from a technical perspective?
 *  Thread Starter [suryamaya](https://wordpress.org/support/users/suryamaya/)
 * (@suryamaya)
 * [2 years, 3 months ago](https://wordpress.org/support/topic/exclude-folder-on-different-domain-sharing-same-database/#post-17411041)
 * Hi [@mateuszgbiorczyk](https://wordpress.org/support/users/mateuszgbiorczyk/),
 * We just change the url while vising the UK and NZ sites. When we upload the images
   on main site they are again copied to the respective uploads folder of these 
   sites. Does this help?
 *  Plugin Author [Mateusz Gbiorczyk](https://wordpress.org/support/users/mateuszgbiorczyk/)
 * (@mateuszgbiorczyk)
 * [2 years, 3 months ago](https://wordpress.org/support/topic/exclude-folder-on-different-domain-sharing-same-database/#post-17411042)
 * [@suryamaya](https://wordpress.org/support/users/suryamaya/) What about content
   and images in the /uploads directory? Are they identical?
 *  Thread Starter [suryamaya](https://wordpress.org/support/users/suryamaya/)
 * (@suryamaya)
 * [2 years, 3 months ago](https://wordpress.org/support/topic/exclude-folder-on-different-domain-sharing-same-database/#post-17411044)
 * [@mateuszgbiorczyk](https://wordpress.org/support/users/mateuszgbiorczyk/) yes
   they are.
 *  Plugin Author [Mateusz Gbiorczyk](https://wordpress.org/support/users/mateuszgbiorczyk/)
 * (@mateuszgbiorczyk)
 * [2 years, 3 months ago](https://wordpress.org/support/topic/exclude-folder-on-different-domain-sharing-same-database/#post-17411046)
 * [@suryamaya](https://wordpress.org/support/users/suryamaya/) But the WordPress
   files are different – for each site you have separate WordPress files, plugins
   and so on?
 *  Thread Starter [suryamaya](https://wordpress.org/support/users/suryamaya/)
 * (@suryamaya)
 * [2 years, 3 months ago](https://wordpress.org/support/topic/exclude-folder-on-different-domain-sharing-same-database/#post-17411051)
 * [@mateuszgbiorczyk](https://wordpress.org/support/users/mateuszgbiorczyk/) Like
   I mentioned main site has one wp set up (files, plugins etc) and other two have
   one wp set up, just the files and plugins and they are copy of the main site 
   but in a different folder.
   Not sure if your exclusion feature works on this case.
   Please advise.
 *  Plugin Author [Mateusz Gbiorczyk](https://wordpress.org/support/users/mateuszgbiorczyk/)
 * (@mateuszgbiorczyk)
 * [2 years, 3 months ago](https://wordpress.org/support/topic/exclude-folder-on-different-domain-sharing-same-database/#post-17411053)
 * [@suryamaya](https://wordpress.org/support/users/suryamaya/) I have never tested
   such a case. You can just check it out. If you exclude a directory, after saving
   the changes it will disappear from the Bulk Optimization of Images section.
 *  Thread Starter [suryamaya](https://wordpress.org/support/users/suryamaya/)
 * (@suryamaya)
 * [2 years, 3 months ago](https://wordpress.org/support/topic/exclude-folder-on-different-domain-sharing-same-database/#post-17411057)
 * [@mateuszgbiorczyk](https://wordpress.org/support/users/mateuszgbiorczyk/) Sure
   I will try. You have provided the example of the image. Can we exclude the folder
   as well like the uploads/2024?
 *  Plugin Author [Mateusz Gbiorczyk](https://wordpress.org/support/users/mateuszgbiorczyk/)
 * (@mateuszgbiorczyk)
 * [2 years, 3 months ago](https://wordpress.org/support/topic/exclude-folder-on-different-domain-sharing-same-database/#post-17411063)
 * [@suryamaya](https://wordpress.org/support/users/suryamaya/) In the Advanced 
   Settings tab you can exclude directories, or you can use the filter below to 
   be more specific:
 *     ```
       add_filter( 'webpc_supported_source_directory', function( bool $status, string $directory_name, string $server_path ): bool {
           $excluded_directories = [ 'my-directory' ];
           if ( in_array( $directory_name, $excluded_directories ) ) {
               return false;
           }
           return $status;
       }, 10, 3 );
       ```
   
 * Please note the `$server_path` variable – you can modify this filter code to 
   use this variable.

Viewing 15 replies - 1 through 15 (of 17 total)

1 [2](https://wordpress.org/support/topic/exclude-folder-on-different-domain-sharing-same-database/page/2/?output_format=md)
[→](https://wordpress.org/support/topic/exclude-folder-on-different-domain-sharing-same-database/page/2/?output_format=md)

The topic ‘Exclude folder on different domain sharing same database’ is closed to
new replies.

 * ![](https://ps.w.org/webp-converter-for-media/assets/icon-256x256.png?rev=2636288)
 * [Converter for Media - Optimize images | Convert WebP & AVIF](https://wordpress.org/plugins/webp-converter-for-media/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/webp-converter-for-media/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/webp-converter-for-media/)
 * [Active Topics](https://wordpress.org/support/plugin/webp-converter-for-media/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/webp-converter-for-media/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/webp-converter-for-media/reviews/)

## Tags

 * [exclude](https://wordpress.org/support/topic-tag/exclude/)
 * [filter](https://wordpress.org/support/topic-tag/filter/)

 * 17 replies
 * 2 participants
 * Last reply from: [Mateusz Gbiorczyk](https://wordpress.org/support/users/mateuszgbiorczyk/)
 * Last activity: [2 years, 3 months ago](https://wordpress.org/support/topic/exclude-folder-on-different-domain-sharing-same-database/page/2/#post-17411080)
 * Status: resolved