Does NextJS copy images for export? - wordpress

I am creating a website that is meant to be a static website, but I have a photo gallery with descriptions on one page that I am using WordPress as the CMS. All the data is from WP is fetched using getStaticProps().
My question is, when you run next export, does Next export these images to the output folder? If not, the img link will not work, since it will link to my computer.
If that doesn't work, any thoughts as to how this can be solved without running a server?

No, Next.js does not export the images files to the output folder. If your wordpress is already deployed, the img link will work for next export, otherwise it will be linked to your localhost if your wordpress is not deployed.

Related

404 Error on Images Locally with WAMP/phpMyAdmin

I recently set up a WAMP server using phpMyAdmin and am having issues displaying images pulled from my website hosted via Pantheon. I've got everything running fine, but the images will not display.
I've exported my website's database via Pantheon and imported with phpMyadmin and the theme loads correctly, but not any images. It's running on WordPress as well. I've tried to find specific examples of this happening, but I'm not sure what the deal is. Any information would be appreciated.
If i get it right you exported you wp site and imported it at a local machine ?
Have you checked / changed the site url in wp ?
If in wp the site url dont match the real url the links to the files can get broken ..
Look at our site code in browser and there you should find the image link to see what wp realy try to load.
Solved. Had to extract the contents of the .tar file into the "uploads" directory, twice. There was no explanation to do this in any of the documentation I could find, I didn't understand how .tar files work.

wordpress css link broken after migrate to localhost

I take backup from live wordpress site then try to run at localhost
import database
create folder web and paste all backup code
change database name n other stuff from config.php file
but site look like
i use these two line to avoid redirection to live site url
its work but not for all url
define('WP_HOME','localhost/web/');
define('WP_SITEURL','localhost/web/');
below links broken....please give solution
primarily twentyeleven theme css link broken
To avoid most of the issues, I would recommend to set up a fresh local version of WordPress and than import theme and content.
Maybe you have to change some setting in the database to adjust this to your local environment.

Migrating the media files from one wordpress site to another

I'm moving a wordpress site from one hosting provider to another. I copied the media files from the folder wp_content/upload from the source site to the destination. I see that the files are there in the upload folder.
I did an export of all the content from the source site. Then I imported into the destination one. This carried over categories etc...
When I go to the media\library menu item in the dashboard, I don't see all the files that I have moved. I see only half of the files that I have moved.
What should I do to see all the files that have been uploaded in the dashboard?
If you already have the images inside the media library actual folder you could use the plugin "Media from FTP" it will easily scan your actual media library folder and "add" the images that are not there.
The plugin will "register" the images in the folder to the wordpress database.
Another solution will be to modify your XML file to point to a place in your actual domain (the destination) outside the media library.
Say you have your destination domain as: yournewsite.com
You will want to export the origin pictures to yournewsite.com
You edit the export XML file and modify all the references to youroldersite.com/wpcontent/uploads to yournewsite.com/uploads
You then move the actual images from youroldsite.com/wp-content/uploads/ into yournewsite.com/uploads
That way you don't "overwrite' the pictures when you do the import, you let wordpress read the images from your new domain and allow you to insert them into yournewsite.com/wp-content/uploads
For some reason, when wordpress tries to read the images from youroldsite it will fail and tell you media import error and you get an empty media library.
With the trick I told you, you will populate your library just fine.

Images not working in wordpress installed in a subdomain/subdirectory

I installed a copy of another wordpress installation of a client in a subdomain. All seems to work fine but images don't. I'm using videos as background and they are working perfect. If I take a look inside the media menu the images are not visible (you can only see an X for every image), but if you manually take the link of every image all the links works fine and images are accesible.
I suspect that issue is related with any of the functions that process images. Maybe some kind of error related with the subdomain which obviously have a dot in the domain name.
¿Any idea?
Thanks in advance!
I assume that you uploaded the images of the client's WordPress installation via FTP.
As far as I know WordPress Media Library cannot “see” images that are not uploaded through the Media Library uploader. The Media Library uploader (aside from uploading your media) creates necessary references within WordPress which you don't have when uploading media via ftp.
This is a common WordPress flaw. There are plugins which might solve your problem by creating the necessary references after such a ftp upload, e.g. Add From Server.

how to export wordpress pages,posts with media for another site

I have wordpress site i need to export posts , pages with media and attachments engaged with them.
and need to use it in another wordpress site.
Also i have installed the woocommerce in it , i need to export the store settings, products, categories , tags with images used for it...
There are many custom post types used in my site. i need to also export theme with medias used...
I tried using Tools -> Import / Export but that does not exports the data with media or images.
Need an immediate help..
Thanks
I just found out how to do this today, and answered this question with a great guide with photos on how to use the export and import tools in WordPress to transfer photos to a new site to be used in posts and pages. This is done by editing the xml files to show the correctly transferred image URLs.
Since I can't post photos because of my reputation, here is the link.
https://wordpress.stackexchange.com/questions/117344/failed-to-import-media/372304#372304
I have wordpress site i need to export posts , pages with media and attachments engaged with them. and need to use it in another wordpress site.
Also i have installed the woocommerce in it , i need to export the store settings, products, categories , tags with images used for it...
There are many custom post types used in my site. i need to also export theme with medias used...
I don't think so you had left something un-neccessary, So Download the database and import it wherever your new database you want to store.
Then download the wp-content/themes, wp-content/uploads, wp-content/plugins Directories. OR Simply Download your wp-content directory. Now you have everything.
I have Everything Now?
Now download the wordpress from wordpress.org and install it to your server. After complete the Installation, Replace the wp-content directory with your new installed wordpress. We assigned our old stuff to New Wordpress.
Now its time to replace Database. There are several online tutorials to replace your old database to new one.
There are multiple ways you can do this:
Manual
Using plugin
For manual, it's a little more lengthy process, you need to download complete files from one server and upload it to another. Do some changes to the backup DB i.e replacing urls and then uploading the DB file as well.
Other way, which is far more better is to use the plugin called as "All in one Migration". Here is the link which can guide you on the complete process:
https://makersbyte.com/easily-export-import-wordpress-sites/
Exporting your WordPress site can be used for site moves or simple backups. In this guide, I’ll provide some simple and easy options to export your WordPress sites for both non-technical and technical people.
Exporting your site creates a backup of your site, usually in the form of a .tar.gz or .zip file, which you can then use to restore or migrate your site to another domain or host. Once you have the backup it’s an easy matter loading a blank WordPress site, loading the plugin, and then restoring the site from your backup file.
When you export your WordPress sites you have the choice to export all your posts, pages, comments, custom fields, terms, navigation menus, and custom posts but the downside to this approach and it’s that WordPress doesn’t export plugins, theme, and settings of your site.
Export Site
1. Log into WordPress
2. Go to Tools > Export
3. Choose what you want to export:
-All
-Posts
-Pages
-Media
4. Click Download Export File. This will download a .xml file to your computer.
Import Site
1. Log in to the WordPress site you want to import it to.
2. Go to Tools > Import.
3. Find the option called WordPress at the bottom and click Install
Now.
4. When it’s finished installing, click Run Importer.
5. Upload the .xml file you exported.
Once you’ve completed exporting your site, you will want to test everything on the site. Make sure that you look for dead links, check menus, and any functionality or post that you consider important to your website.
It doesn’t have to be hard to export your WordPress sites. There are options for everyone, no matter what level of technical skill you have. And should you ever encounter a conflict, hack, or choose to move your site, having an export of your site is invaluable.

Resources