Docs>Import WP Importer>How to guides

How to Import WordPress Attachments onto a Post Type

Attachments can be imported on WordPress Pages, Posts, Custom post types, and all templates using these as a base. Attachments can be fetched from within a local directory, remote url, or from a ftp server.

Importing an Attachment

To add a new attachment click on the Add Row button at the bottom of the attachments panel, this will insert a new row.

OptionsDescription
LocationThe location field should be the source of the file or files that you want to attach, to import multiple files you can enter a comma separated list of attachment sources.
The location field is used for all download types (ftp, local filesystem, remote url).
Is Featured?The is featured field allows you to set the featured image on the first attachment imported.
DownloadThe download field sets how the attachments should be imported (ftp, local filesystem, remote url).

Import attachments via FTP

To import attachments via FTP set the download option to FTP, this will enable an extra set of fields to configure the FTP connection.

OptionsDescription
HostThe ftp host
UsernameThe ftp username
PasswordThe ftp password
PathThe path is an optional field, this filed will prefix each attachment source set in the location field.

Import attachments from the Local Filesystem

To import attachments from the Local Filesystem set the download option to Local Filesystem, this will enable an extra field allowing you to set the base path to the attachment files on the local filesystem.

OptionsDescription
Base URLThe base URL is an optional field, this filed will prefix each attachment source set in the location field.

Import attachments from a Remote Url

To import attachments from the Remote Url set the download option to Remote Url, this will enable an extra field allowing you to set the base url to the attachment files on the remote server.

OptionsDescription
Base URLThe base URL is an optional field, this filed will prefix each attachment source set in the location field.

Enable Meta

This enable meta field enables extra field to populate attachment meta data:

OptionsDescription
Alt TextSet the attachments alt text.
Title TextSet the attachments title text.
Caption TextSet the attachments caption text.
Description TextSet the attachments description.

How to change the attachment value delimiter / seperator

By default entering multiple images in the location field seperated by a comma will import multiple images.

You can change the attachment delimiter / seperator by using the following code

add_filter('iwp/attachment/value_delimiter', function($delimiter){
    return ','; // change the , to any character e.g. | ; or #
});

Next Section