In wpDataTables you can setup tables using an input source like an xlsx or csv. This is great for data that needs to be updated frequently because you can just replace the spreadsheet.
However, once you move your website from say a development server to a live server because you are ready to launch the site, you might find the table is no longer accessible in the front end or the backend. Even in WordPress when you go to click on your table in the wpDataTables plugin you will be given an error message like this:
“Error Provided file /nas/content/live/user/wp-content/uploads/spreadsheet.xlsx does not exist!”
Unfortunately, this completely restricts your access to the table. You can’t just switch the data source. However, if you have access to cPanel and phpMyAdmin you can fix this.
How to find and replace wpDataTables input source file URL – cPanel hosting
- Login to cPanel
- Open up File Manager and navigate to the spreadsheet folder within your uploads. You should be able to see which uploads folder its in based on the error message.
- Select the spreadsheet, and then look at the left side of the screen:
You will need to combine these two URLS to create the full, starting with the URL on the bottom and then the one on the top, e.g.:/home/user/public_html/prelive/wp-content/uploads/2021/06/spreadsheet.xlsx
- Now, close File Manager and return to cPanel.
- Click on phpMyAdmin
- Select your WordPress database
- Select the table “wp_wpdatatables”
- Now you should see a list of all your tables. Find the table you need to fix.
- In the “content” column you will see the spreadsheet url, click into this table cell and replace with the new URL
- Check your website, the issue should now be fixed.