Not updating pdf link when using use new file name and update all links option
-
When I use the ‘Replace the file, use new file name and update all links’ option, the links are not getting updated. I checked the wp-posts table and see that all the urls have the same path up to the file name and include the domain (https://domain/uploads/…/file.pdf)
Case A: The file _is_ actually replaced as it should, but a browser cache makes it look like the file is not replaced. Solution: Clear browser cache or try in another browser/computer that has not previously accessed the file.
– Cleared browser cache (chrome) and tried Firefox because I haven’t been to the site with it yet. Edit the page and see that the link is still set to the old one.Case B: The original file on the server (the file you want to replace) has wrong file permissions, and the web server does not have permission to delete the file. Solution: Make sure web server user on server (usually ‘www-data’ on a Linux system) has permissions to delete the file.
Case C: The web server user on the server does not have permission to write to the uploads folder. Solution: Make sure web server user on server (usually ‘www-data’ on a Linux system) has permissions to write to the uploads folder.
– Permissions on the uploads folder and sub folders are 771 and the files are 660. We host multiple sites on the same server and don’t use www-data. Each site has it’s own unique name for the web server user. The original file does get deleted, (not the other WP generated files like thumbnail, medium, etc) when I check after replacing and renaming with a new file.
- The topic ‘Not updating pdf link when using use new file name and update all links option’ is closed to new replies.