{"id":10730,"date":"2025-12-01T16:33:30","date_gmt":"2025-12-01T22:33:30","guid":{"rendered":"https:\/\/infiniteuploads.com\/?post_type=docs&#038;p=10730"},"modified":"2025-12-01T16:37:32","modified_gmt":"2025-12-01T22:37:32","password":"","slug":"filtering-synced-paths-with-infinite_uploads_sync_exclusions","status":"publish","type":"docs","link":"https:\/\/infiniteuploads.com\/docs\/developers\/filtering-synced-paths-with-infinite_uploads_sync_exclusions\/","title":{"rendered":"Filtering Synced Paths with infinite_uploads_sync_exclusions"},"content":{"rendered":"<!DOCTYPE html PUBLIC \"-\/\/W3C\/\/DTD HTML 4.0 Transitional\/\/EN\" \"http:\/\/www.w3.org\/TR\/REC-html40\/loose.dtd\">\n<html><body><p class=\"wp-block-paragraph\">Infinite Uploads provides a developer hook that allows plugins and themes to <strong>exclude specific local paths from being offloaded<\/strong> to the Infinite Uploads cloud. This is especially useful when third-party plugins store backups, temporary assets, or processing files that should remain on the server.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The example below demonstrates how ShortPixel integrates with Infinite Uploads to ensure its backup directory is never synced to cloud storage.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"overview\">Overview<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">The <code>infinite_uploads_sync_exclusions<\/code> filter makes it possible to append custom directory rules that prevent certain files or folders within <code>wp-content\/uploads\/<\/code> from being offloaded.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Infinite Uploads always processes local media through its internal sync routines. Using this filter gives developers control over which paths should be skipped during the offload process.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"usage-example\">Usage Example<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Here is a full example of how to use the filter to exclude the ShortPixel backup directory:<\/p>\n\n\n\n<div class=\"betterdocs-code-snippet-wrapper theme-light betterdocs-code-snippet-b0d7e2da\" id=\"betterdocs-code-snippet-b0d7e2da\" data-language=\"php\" data-copy-button=\"true\">\n\n            <div class=\"betterdocs-code-snippet-header betterdocs-file-preview-header\">\n        <div class=\"betterdocs-file-preview-left\">\n                            <div class=\"betterdocs-traffic-lights\">\n                    <span class=\"traffic-light traffic-light-red\"><\/span>\n                    <span class=\"traffic-light traffic-light-yellow\"><\/span>\n                    <span class=\"traffic-light traffic-light-green\"><\/span>\n                <\/div>\n            \n                            <div class=\"betterdocs-file-info\">\n                                            <div class=\"betterdocs-file-icon\">\n                                                            <span class=\"betterdocs-file-icon-emoji\">&#128024;<\/span>\n                                                    <\/div>\n                    \n                                    <\/div>\n                    <\/div>\n\n        <div class=\"betterdocs-file-preview-right\">\n            \n                                    <div class=\"betterdocs-code-snippet-copy-container\">\n            <button class=\"betterdocs-code-snippet-copy-button\" type=\"button\" aria-label=\"Copy code to clipboard\">\n                <span class=\"betterdocs-code-snippet-copy-icon\" aria-hidden=\"true\">\n                    <svg width=\"16\" height=\"16\" viewbox=\"0 0 24 24\" fill=\"none\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\">\n                        <rect x=\"9\" y=\"9\" width=\"12.5\" height=\"12.5\" rx=\"3\" stroke=\"currentColor\" stroke-width=\"1.7\"><\/rect>\n                        <path d=\"M15.5 5.75V5A2.5 2.5 0 0 0 13 2.5H5A2.5 2.5 0 0 0 2.5 5v8A2.5 2.5 0 0 0 5 15.5h.75\" stroke=\"currentColor\" stroke-width=\"1.7\" stroke-linecap=\"round\"><\/path>\n                    <\/svg>\n                <\/span>\n                <span class=\"betterdocs-code-snippet-copied-icon\" aria-hidden=\"true\">\n                    <svg width=\"16\" height=\"16\" viewbox=\"0 0 24 24\" fill=\"none\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\">\n                        <path d=\"M20 6.5 9.5 17 4 11.5\" stroke=\"currentColor\" stroke-width=\"2.2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><\/path>\n                    <\/svg>\n                <\/span>\n            <\/button>\n            <span class=\"betterdocs-code-snippet-tooltip\" role=\"status\" data-copy-label=\"Copy\" data-copied-label=\"Copied!\" data-error-label=\"Copy failed\">Copy<\/span>\n        <\/div>\n                            <\/div>\n        <\/div>\n    \n    <div class=\"betterdocs-code-snippet-content\">\n                                <div class=\"betterdocs-code-snippet-panel is-active\" data-lang-index=\"0\">\n                \n                <pre class=\"betterdocs-code-snippet-code language-php\"><code>add_filter( 'infinite_uploads_sync_exclusions', 'compatibility_exclusions' );\n\nfunction compatibility_exclusions( $exclusions ) {\n\n    \/\/ Add the ShortPixel backups folder to the exclusion list\n    $exclusions[] = 'wp-content\/uploads\/ShortpixelBackups\/';\n\n    return $exclusions;\n}\n<\/code><\/pre>\n            <\/div>\n            <\/div>\n<\/div>\n\n<script type=\"text\/javascript\">\ndocument.addEventListener('DOMContentLoaded', function() {\n    \/\/ Initialize copy functionality for this specific snippet\n    const snippet = document.getElementById('betterdocs-code-snippet-b0d7e2da');\n    if (snippet && window.BetterDocsCodeSnippet) {\n        window.BetterDocsCodeSnippet.initCopyButton(snippet);\n    }\n});\n<\/script>\n\n\n\n<p class=\"wp-block-paragraph\">This ensures that the following path <strong>will always remain local<\/strong>:<\/p>\n\n\n\n<div class=\"betterdocs-code-snippet-wrapper theme-light betterdocs-code-snippet-83f0a996\" id=\"betterdocs-code-snippet-83f0a996\" data-language=\"json\" data-copy-button=\"true\">\n\n            <div class=\"betterdocs-code-snippet-header betterdocs-file-preview-header\">\n        <div class=\"betterdocs-file-preview-left\">\n                            <div class=\"betterdocs-traffic-lights\">\n                    <span class=\"traffic-light traffic-light-red\"><\/span>\n                    <span class=\"traffic-light traffic-light-yellow\"><\/span>\n                    <span class=\"traffic-light traffic-light-green\"><\/span>\n                <\/div>\n            \n                            <div class=\"betterdocs-file-info\">\n                                            <div class=\"betterdocs-file-icon\">\n                                                            <span class=\"betterdocs-file-icon-emoji\">&#128203;<\/span>\n                                                    <\/div>\n                    \n                                    <\/div>\n                    <\/div>\n\n        <div class=\"betterdocs-file-preview-right\">\n            \n                                    <div class=\"betterdocs-code-snippet-copy-container\">\n            <button class=\"betterdocs-code-snippet-copy-button\" type=\"button\" aria-label=\"Copy code to clipboard\">\n                <span class=\"betterdocs-code-snippet-copy-icon\" aria-hidden=\"true\">\n                    <svg width=\"16\" height=\"16\" viewbox=\"0 0 24 24\" fill=\"none\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\">\n                        <rect x=\"9\" y=\"9\" width=\"12.5\" height=\"12.5\" rx=\"3\" stroke=\"currentColor\" stroke-width=\"1.7\"><\/rect>\n                        <path d=\"M15.5 5.75V5A2.5 2.5 0 0 0 13 2.5H5A2.5 2.5 0 0 0 2.5 5v8A2.5 2.5 0 0 0 5 15.5h.75\" stroke=\"currentColor\" stroke-width=\"1.7\" stroke-linecap=\"round\"><\/path>\n                    <\/svg>\n                <\/span>\n                <span class=\"betterdocs-code-snippet-copied-icon\" aria-hidden=\"true\">\n                    <svg width=\"16\" height=\"16\" viewbox=\"0 0 24 24\" fill=\"none\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\">\n                        <path d=\"M20 6.5 9.5 17 4 11.5\" stroke=\"currentColor\" stroke-width=\"2.2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><\/path>\n                    <\/svg>\n                <\/span>\n            <\/button>\n            <span class=\"betterdocs-code-snippet-tooltip\" role=\"status\" data-copy-label=\"Copy\" data-copied-label=\"Copied!\" data-error-label=\"Copy failed\">Copy<\/span>\n        <\/div>\n                            <\/div>\n        <\/div>\n    \n    <div class=\"betterdocs-code-snippet-content\">\n                                <div class=\"betterdocs-code-snippet-panel is-active\" data-lang-index=\"0\">\n                \n                <pre class=\"betterdocs-code-snippet-code language-json\"><code>wp-content\/uploads\/folder\/<\/code><\/pre>\n            <\/div>\n            <\/div>\n<\/div>\n\n<script type=\"text\/javascript\">\ndocument.addEventListener('DOMContentLoaded', function() {\n    \/\/ Initialize copy functionality for this specific snippet\n    const snippet = document.getElementById('betterdocs-code-snippet-83f0a996');\n    if (snippet && window.BetterDocsCodeSnippet) {\n        window.BetterDocsCodeSnippet.initCopyButton(snippet);\n    }\n});\n<\/script>\n\n\n\n<p class=\"wp-block-paragraph\">Infinite Uploads merges your exclusions with its own internal defaults during sync operations.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"parameters\">Parameters<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"-exclusions\"><strong>$exclusions<\/strong><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\"><em>(array)<\/em><br>A list of directory paths (relative to the WordPress root) that Infinite Uploads will skip when performing sync\/offload operations.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Each value should be:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>a <strong>string<\/strong>,<\/li>\n\n\n\n<li>representing a <strong>relative path<\/strong>,<\/li>\n\n\n\n<li>ending with a trailing slash.<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">Example:<\/p>\n\n\n\n<div class=\"betterdocs-code-snippet-wrapper theme-light betterdocs-code-snippet-a632bdf1\" id=\"betterdocs-code-snippet-a632bdf1\" data-language=\"php\" data-copy-button=\"true\">\n\n            <div class=\"betterdocs-code-snippet-header betterdocs-file-preview-header\">\n        <div class=\"betterdocs-file-preview-left\">\n                            <div class=\"betterdocs-traffic-lights\">\n                    <span class=\"traffic-light traffic-light-red\"><\/span>\n                    <span class=\"traffic-light traffic-light-yellow\"><\/span>\n                    <span class=\"traffic-light traffic-light-green\"><\/span>\n                <\/div>\n            \n                            <div class=\"betterdocs-file-info\">\n                                            <div class=\"betterdocs-file-icon\">\n                                                            <span class=\"betterdocs-file-icon-emoji\">&#128024;<\/span>\n                                                    <\/div>\n                    \n                                    <\/div>\n                    <\/div>\n\n        <div class=\"betterdocs-file-preview-right\">\n            \n                                    <div class=\"betterdocs-code-snippet-copy-container\">\n            <button class=\"betterdocs-code-snippet-copy-button\" type=\"button\" aria-label=\"Copy code to clipboard\">\n                <span class=\"betterdocs-code-snippet-copy-icon\" aria-hidden=\"true\">\n                    <svg width=\"16\" height=\"16\" viewbox=\"0 0 24 24\" fill=\"none\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\">\n                        <rect x=\"9\" y=\"9\" width=\"12.5\" height=\"12.5\" rx=\"3\" stroke=\"currentColor\" stroke-width=\"1.7\"><\/rect>\n                        <path d=\"M15.5 5.75V5A2.5 2.5 0 0 0 13 2.5H5A2.5 2.5 0 0 0 2.5 5v8A2.5 2.5 0 0 0 5 15.5h.75\" stroke=\"currentColor\" stroke-width=\"1.7\" stroke-linecap=\"round\"><\/path>\n                    <\/svg>\n                <\/span>\n                <span class=\"betterdocs-code-snippet-copied-icon\" aria-hidden=\"true\">\n                    <svg width=\"16\" height=\"16\" viewbox=\"0 0 24 24\" fill=\"none\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\">\n                        <path d=\"M20 6.5 9.5 17 4 11.5\" stroke=\"currentColor\" stroke-width=\"2.2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><\/path>\n                    <\/svg>\n                <\/span>\n            <\/button>\n            <span class=\"betterdocs-code-snippet-tooltip\" role=\"status\" data-copy-label=\"Copy\" data-copied-label=\"Copied!\" data-error-label=\"Copy failed\">Copy<\/span>\n        <\/div>\n                            <\/div>\n        <\/div>\n    \n    <div class=\"betterdocs-code-snippet-content\">\n                                <div class=\"betterdocs-code-snippet-panel is-active\" data-lang-index=\"0\">\n                \n                <pre class=\"betterdocs-code-snippet-code language-php\"><code>$exclusions[] = 'wp-content\/uploads\/custom-folder\/';\n<\/code><\/pre>\n            <\/div>\n            <\/div>\n<\/div>\n\n<script type=\"text\/javascript\">\ndocument.addEventListener('DOMContentLoaded', function() {\n    \/\/ Initialize copy functionality for this specific snippet\n    const snippet = document.getElementById('betterdocs-code-snippet-a632bdf1');\n    if (snippet && window.BetterDocsCodeSnippet) {\n        window.BetterDocsCodeSnippet.initCopyButton(snippet);\n    }\n});\n<\/script>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"when-to-use-this-filter\">When to Use This Filter<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Use <code>infinite_uploads_sync_exclusions<\/code> when you need to ensure:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Backup folders are never offloaded<\/li>\n\n\n\n<li>Plugins generate temporary processing files<\/li>\n\n\n\n<li>Generated assets should remain local<\/li>\n\n\n\n<li>Uploads created by automation tasks shouldn&rsquo;t be stored in the cloud<\/li>\n\n\n\n<li>Sensitive files require local-only storage<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"best-practices\">Best Practices<\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Always include the <strong>full relative path<\/strong> starting after the WordPress installation root.<\/li>\n\n\n\n<li>Always end paths with <strong>a trailing slash<\/strong>.<\/li>\n\n\n\n<li>Keep exclusions narrow&mdash;excluding entire upload years or months may affect normal media behavior.<\/li>\n\n\n\n<li>Avoid excluding folders that hold standard WordPress media items.<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"additional-developer-resources\">Additional Developer Resources<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">If you are also integrating deeper Infinite Uploads functionality, here are related APIs available (shown in your integration notes for convenience):<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"check-if-a-file-is-offloaded\">Check if a File Is Offloaded<\/h2>\n\n\n\n<div class=\"betterdocs-code-snippet-wrapper theme-light betterdocs-code-snippet-b278c604\" id=\"betterdocs-code-snippet-b278c604\" data-language=\"php\" data-copy-button=\"true\">\n\n            <div class=\"betterdocs-code-snippet-header betterdocs-file-preview-header\">\n        <div class=\"betterdocs-file-preview-left\">\n                            <div class=\"betterdocs-traffic-lights\">\n                    <span class=\"traffic-light traffic-light-red\"><\/span>\n                    <span class=\"traffic-light traffic-light-yellow\"><\/span>\n                    <span class=\"traffic-light traffic-light-green\"><\/span>\n                <\/div>\n            \n                            <div class=\"betterdocs-file-info\">\n                                            <div class=\"betterdocs-file-icon\">\n                                                            <span class=\"betterdocs-file-icon-emoji\">&#128024;<\/span>\n                                                    <\/div>\n                    \n                                    <\/div>\n                    <\/div>\n\n        <div class=\"betterdocs-file-preview-right\">\n            \n                                    <div class=\"betterdocs-code-snippet-copy-container\">\n            <button class=\"betterdocs-code-snippet-copy-button\" type=\"button\" aria-label=\"Copy code to clipboard\">\n                <span class=\"betterdocs-code-snippet-copy-icon\" aria-hidden=\"true\">\n                    <svg width=\"16\" height=\"16\" viewbox=\"0 0 24 24\" fill=\"none\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\">\n                        <rect x=\"9\" y=\"9\" width=\"12.5\" height=\"12.5\" rx=\"3\" stroke=\"currentColor\" stroke-width=\"1.7\"><\/rect>\n                        <path d=\"M15.5 5.75V5A2.5 2.5 0 0 0 13 2.5H5A2.5 2.5 0 0 0 2.5 5v8A2.5 2.5 0 0 0 5 15.5h.75\" stroke=\"currentColor\" stroke-width=\"1.7\" stroke-linecap=\"round\"><\/path>\n                    <\/svg>\n                <\/span>\n                <span class=\"betterdocs-code-snippet-copied-icon\" aria-hidden=\"true\">\n                    <svg width=\"16\" height=\"16\" viewbox=\"0 0 24 24\" fill=\"none\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\">\n                        <path d=\"M20 6.5 9.5 17 4 11.5\" stroke=\"currentColor\" stroke-width=\"2.2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><\/path>\n                    <\/svg>\n                <\/span>\n            <\/button>\n            <span class=\"betterdocs-code-snippet-tooltip\" role=\"status\" data-copy-label=\"Copy\" data-copied-label=\"Copied!\" data-error-label=\"Copy failed\">Copy<\/span>\n        <\/div>\n                            <\/div>\n        <\/div>\n    \n    <div class=\"betterdocs-code-snippet-content\">\n                                <div class=\"betterdocs-code-snippet-panel is-active\" data-lang-index=\"0\">\n                \n                <pre class=\"betterdocs-code-snippet-code language-php\"><code>infinite_uploads_check_offloaded( $url );\n<\/code><\/pre>\n            <\/div>\n            <\/div>\n<\/div>\n\n<script type=\"text\/javascript\">\ndocument.addEventListener('DOMContentLoaded', function() {\n    \/\/ Initialize copy functionality for this specific snippet\n    const snippet = document.getElementById('betterdocs-code-snippet-b278c604');\n    if (snippet && window.BetterDocsCodeSnippet) {\n        window.BetterDocsCodeSnippet.initCopyButton(snippet);\n    }\n});\n<\/script>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"offload-or-download-a-file-programmatically\">Offload or Download a File Programmatically<\/h2>\n\n\n\n<div class=\"betterdocs-code-snippet-wrapper theme-light betterdocs-code-snippet-a99ed35c\" id=\"betterdocs-code-snippet-a99ed35c\" data-language=\"php\" data-copy-button=\"true\">\n\n            <div class=\"betterdocs-code-snippet-header betterdocs-file-preview-header\">\n        <div class=\"betterdocs-file-preview-left\">\n                            <div class=\"betterdocs-traffic-lights\">\n                    <span class=\"traffic-light traffic-light-red\"><\/span>\n                    <span class=\"traffic-light traffic-light-yellow\"><\/span>\n                    <span class=\"traffic-light traffic-light-green\"><\/span>\n                <\/div>\n            \n                            <div class=\"betterdocs-file-info\">\n                                            <div class=\"betterdocs-file-icon\">\n                                                            <span class=\"betterdocs-file-icon-emoji\">&#128024;<\/span>\n                                                    <\/div>\n                    \n                                    <\/div>\n                    <\/div>\n\n        <div class=\"betterdocs-file-preview-right\">\n            \n                                    <div class=\"betterdocs-code-snippet-copy-container\">\n            <button class=\"betterdocs-code-snippet-copy-button\" type=\"button\" aria-label=\"Copy code to clipboard\">\n                <span class=\"betterdocs-code-snippet-copy-icon\" aria-hidden=\"true\">\n                    <svg width=\"16\" height=\"16\" viewbox=\"0 0 24 24\" fill=\"none\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\">\n                        <rect x=\"9\" y=\"9\" width=\"12.5\" height=\"12.5\" rx=\"3\" stroke=\"currentColor\" stroke-width=\"1.7\"><\/rect>\n                        <path d=\"M15.5 5.75V5A2.5 2.5 0 0 0 13 2.5H5A2.5 2.5 0 0 0 2.5 5v8A2.5 2.5 0 0 0 5 15.5h.75\" stroke=\"currentColor\" stroke-width=\"1.7\" stroke-linecap=\"round\"><\/path>\n                    <\/svg>\n                <\/span>\n                <span class=\"betterdocs-code-snippet-copied-icon\" aria-hidden=\"true\">\n                    <svg width=\"16\" height=\"16\" viewbox=\"0 0 24 24\" fill=\"none\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\">\n                        <path d=\"M20 6.5 9.5 17 4 11.5\" stroke=\"currentColor\" stroke-width=\"2.2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><\/path>\n                    <\/svg>\n                <\/span>\n            <\/button>\n            <span class=\"betterdocs-code-snippet-tooltip\" role=\"status\" data-copy-label=\"Copy\" data-copied-label=\"Copied!\" data-error-label=\"Copy failed\">Copy<\/span>\n        <\/div>\n                            <\/div>\n        <\/div>\n    \n    <div class=\"betterdocs-code-snippet-content\">\n                                <div class=\"betterdocs-code-snippet-panel is-active\" data-lang-index=\"0\">\n                \n                <pre class=\"betterdocs-code-snippet-code language-php\"><code>$admin = new Infinite_Uploads_Admin();\n$admin-&gt;offload_image( '\/2025\/05\/example.png' );\n$admin-&gt;download_image( '\/2025\/05\/example.png' );\n<\/code><\/pre>\n            <\/div>\n            <\/div>\n<\/div>\n\n<script type=\"text\/javascript\">\ndocument.addEventListener('DOMContentLoaded', function() {\n    \/\/ Initialize copy functionality for this specific snippet\n    const snippet = document.getElementById('betterdocs-code-snippet-a99ed35c');\n    if (snippet && window.BetterDocsCodeSnippet) {\n        window.BetterDocsCodeSnippet.initCopyButton(snippet);\n    }\n});\n<\/script>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"delete-file-from-cloud-storage\">Delete File From Cloud Storage<\/h2>\n\n\n\n<div class=\"betterdocs-code-snippet-wrapper theme-light betterdocs-code-snippet-932c5c57\" id=\"betterdocs-code-snippet-932c5c57\" data-language=\"php\" data-copy-button=\"true\">\n\n            <div class=\"betterdocs-code-snippet-header betterdocs-file-preview-header\">\n        <div class=\"betterdocs-file-preview-left\">\n                            <div class=\"betterdocs-traffic-lights\">\n                    <span class=\"traffic-light traffic-light-red\"><\/span>\n                    <span class=\"traffic-light traffic-light-yellow\"><\/span>\n                    <span class=\"traffic-light traffic-light-green\"><\/span>\n                <\/div>\n            \n                            <div class=\"betterdocs-file-info\">\n                                            <div class=\"betterdocs-file-icon\">\n                                                            <span class=\"betterdocs-file-icon-emoji\">&#128024;<\/span>\n                                                    <\/div>\n                    \n                                    <\/div>\n                    <\/div>\n\n        <div class=\"betterdocs-file-preview-right\">\n            \n                                    <div class=\"betterdocs-code-snippet-copy-container\">\n            <button class=\"betterdocs-code-snippet-copy-button\" type=\"button\" aria-label=\"Copy code to clipboard\">\n                <span class=\"betterdocs-code-snippet-copy-icon\" aria-hidden=\"true\">\n                    <svg width=\"16\" height=\"16\" viewbox=\"0 0 24 24\" fill=\"none\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\">\n                        <rect x=\"9\" y=\"9\" width=\"12.5\" height=\"12.5\" rx=\"3\" stroke=\"currentColor\" stroke-width=\"1.7\"><\/rect>\n                        <path d=\"M15.5 5.75V5A2.5 2.5 0 0 0 13 2.5H5A2.5 2.5 0 0 0 2.5 5v8A2.5 2.5 0 0 0 5 15.5h.75\" stroke=\"currentColor\" stroke-width=\"1.7\" stroke-linecap=\"round\"><\/path>\n                    <\/svg>\n                <\/span>\n                <span class=\"betterdocs-code-snippet-copied-icon\" aria-hidden=\"true\">\n                    <svg width=\"16\" height=\"16\" viewbox=\"0 0 24 24\" fill=\"none\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\">\n                        <path d=\"M20 6.5 9.5 17 4 11.5\" stroke=\"currentColor\" stroke-width=\"2.2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><\/path>\n                    <\/svg>\n                <\/span>\n            <\/button>\n            <span class=\"betterdocs-code-snippet-tooltip\" role=\"status\" data-copy-label=\"Copy\" data-copied-label=\"Copied!\" data-error-label=\"Copy failed\">Copy<\/span>\n        <\/div>\n                            <\/div>\n        <\/div>\n    \n    <div class=\"betterdocs-code-snippet-content\">\n                                <div class=\"betterdocs-code-snippet-panel is-active\" data-lang-index=\"0\">\n                \n                <pre class=\"betterdocs-code-snippet-code language-php\"><code>$iu = new Infinite_Uploads();\n$iu-&gt;infinite_uploads_delete_files_from_cloud( $attachment_id );\n<\/code><\/pre>\n            <\/div>\n            <\/div>\n<\/div>\n\n<script type=\"text\/javascript\">\ndocument.addEventListener('DOMContentLoaded', function() {\n    \/\/ Initialize copy functionality for this specific snippet\n    const snippet = document.getElementById('betterdocs-code-snippet-932c5c57');\n    if (snippet && window.BetterDocsCodeSnippet) {\n        window.BetterDocsCodeSnippet.initCopyButton(snippet);\n    }\n});\n<\/script>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"retrieve-the-site-cdn-url\">Retrieve the Site CDN URL<\/h2>\n\n\n\n<div class=\"betterdocs-code-snippet-wrapper theme-light betterdocs-code-snippet-fa62ba36\" id=\"betterdocs-code-snippet-fa62ba36\" data-language=\"php\" data-copy-button=\"true\">\n\n            <div class=\"betterdocs-code-snippet-header betterdocs-file-preview-header\">\n        <div class=\"betterdocs-file-preview-left\">\n                            <div class=\"betterdocs-traffic-lights\">\n                    <span class=\"traffic-light traffic-light-red\"><\/span>\n                    <span class=\"traffic-light traffic-light-yellow\"><\/span>\n                    <span class=\"traffic-light traffic-light-green\"><\/span>\n                <\/div>\n            \n                            <div class=\"betterdocs-file-info\">\n                                            <div class=\"betterdocs-file-icon\">\n                                                            <span class=\"betterdocs-file-icon-emoji\">&#128024;<\/span>\n                                                    <\/div>\n                    \n                                    <\/div>\n                    <\/div>\n\n        <div class=\"betterdocs-file-preview-right\">\n            \n                                    <div class=\"betterdocs-code-snippet-copy-container\">\n            <button class=\"betterdocs-code-snippet-copy-button\" type=\"button\" aria-label=\"Copy code to clipboard\">\n                <span class=\"betterdocs-code-snippet-copy-icon\" aria-hidden=\"true\">\n                    <svg width=\"16\" height=\"16\" viewbox=\"0 0 24 24\" fill=\"none\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\">\n                        <rect x=\"9\" y=\"9\" width=\"12.5\" height=\"12.5\" rx=\"3\" stroke=\"currentColor\" stroke-width=\"1.7\"><\/rect>\n                        <path d=\"M15.5 5.75V5A2.5 2.5 0 0 0 13 2.5H5A2.5 2.5 0 0 0 2.5 5v8A2.5 2.5 0 0 0 5 15.5h.75\" stroke=\"currentColor\" stroke-width=\"1.7\" stroke-linecap=\"round\"><\/path>\n                    <\/svg>\n                <\/span>\n                <span class=\"betterdocs-code-snippet-copied-icon\" aria-hidden=\"true\">\n                    <svg width=\"16\" height=\"16\" viewbox=\"0 0 24 24\" fill=\"none\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\">\n                        <path d=\"M20 6.5 9.5 17 4 11.5\" stroke=\"currentColor\" stroke-width=\"2.2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><\/path>\n                    <\/svg>\n                <\/span>\n            <\/button>\n            <span class=\"betterdocs-code-snippet-tooltip\" role=\"status\" data-copy-label=\"Copy\" data-copied-label=\"Copied!\" data-error-label=\"Copy failed\">Copy<\/span>\n        <\/div>\n                            <\/div>\n        <\/div>\n    \n    <div class=\"betterdocs-code-snippet-content\">\n                                <div class=\"betterdocs-code-snippet-panel is-active\" data-lang-index=\"0\">\n                \n                <pre class=\"betterdocs-code-snippet-code language-php\"><code>$api   = Infinite_Uploads_Api_Handler::get_instance();\n$data  = $api-&gt;get_site_data();\n$cdn   = $data-&gt;site-&gt;cdn_url;\n<\/code><\/pre>\n            <\/div>\n            <\/div>\n<\/div>\n\n<script type=\"text\/javascript\">\ndocument.addEventListener('DOMContentLoaded', function() {\n    \/\/ Initialize copy functionality for this specific snippet\n    const snippet = document.getElementById('betterdocs-code-snippet-fa62ba36');\n    if (snippet && window.BetterDocsCodeSnippet) {\n        window.BetterDocsCodeSnippet.initCopyButton(snippet);\n    }\n});\n<\/script>\n<\/body><\/html>\n","protected":false},"excerpt":{"rendered":"<p>Infinite Uploads provides a developer hook that allows plugins and themes to exclude specific local paths from being offloaded to the Infinite Uploads cloud. This is especially useful when third-party plugins store backups, temporary assets, or processing files that should remain on the server. The example below demonstrates how ShortPixel integrates with Infinite Uploads to [&hellip;]<\/p>\n","protected":false},"author":3787,"featured_media":10764,"template":"","meta":{"_acf_changed":false,"wds_primary_doc_category":0,"wds_primary_doc_tag":0,"footnotes":""},"doc_category":[147],"doc_tag":[],"class_list":["post-10730","docs","type-docs","status-publish","has-post-thumbnail","hentry","doc_category-developers"],"acf":[],"year_month":"2026-09","word_count":337,"total_views":"530","reactions":{"happy":"0","normal":"0","sad":"0"},"author_info":{"name":"Blake Whittle","author_nicename":"blakew","author_url":"https:\/\/infiniteuploads.com\/blog\/author\/blakew\/"},"doc_category_info":[{"term_name":"Developers","term_url":"https:\/\/infiniteuploads.com\/docs-category\/developers\/"}],"doc_tag_info":[],"knowledge_base_info":[],"knowledge_base_slug":[],"_links":{"self":[{"href":"https:\/\/infiniteuploads.com\/api\/wp\/v2\/docs\/10730","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/infiniteuploads.com\/api\/wp\/v2\/docs"}],"about":[{"href":"https:\/\/infiniteuploads.com\/api\/wp\/v2\/types\/docs"}],"author":[{"embeddable":true,"href":"https:\/\/infiniteuploads.com\/api\/wp\/v2\/users\/3787"}],"version-history":[{"count":0,"href":"https:\/\/infiniteuploads.com\/api\/wp\/v2\/docs\/10730\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/infiniteuploads.com\/api\/wp\/v2\/media\/10764"}],"wp:attachment":[{"href":"https:\/\/infiniteuploads.com\/api\/wp\/v2\/media?parent=10730"}],"wp:term":[{"taxonomy":"doc_category","embeddable":true,"href":"https:\/\/infiniteuploads.com\/api\/wp\/v2\/doc_category?post=10730"},{"taxonomy":"doc_tag","embeddable":true,"href":"https:\/\/infiniteuploads.com\/api\/wp\/v2\/doc_tag?post=10730"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}