• Blog
    • >
    • How To – Import Posts by CSV – Constellation Client Portal

    How To – Import Posts by CSV – Constellation Client Portal

    Steps

    1. Each company referenced in the CSV file must be created (or exist) before attempting to import the CSV file.
    2. If you intend to also attach files (example: pdf, jpg, etc.) to posts, the files must be in the respective company directories before initiating the CSV import. If you upload the files manually (example: via FTP), ensure that your file names do not contain any spaces, and contain only letters, numbers, hyphens, or underscores. See the Upload File Attachments to a Company Directory via SFTP post for more information about uploading files to a company directory.
    3. Prepare your CSV file with the necessary post data. Note: It is recommended that you create a test CSV file with only one row and verify your import before attempting to import multiple posts.
    4. When your CSV file is ready, navigate to the client file or client invoice post list (WordPress Admin -> Client Files or Client Invoices) depending on the kind of posts you are intending to import. Note: If you import a CSV file on the Client File post list page, Client File posts will be created. If you import a CSV file on the Client Invoice post list page, Client Invoice posts will be created.
    5. Click the Bulk Create button at the top, and select your CSV import file.
    6. Click the Import CSV button to initiate the import.

    Example CSV File

    Download an example CSV import file that contains the column headings along with example values (do not import this example without replacing the example data with data specific to your site).

    Note: The dates in the due_date column contain an intentional space before the date. This was done to prevent Excel from automatically changing the date format. If you are having issues with Excel changing the due dates in your CSV file from something other than YYYY-MM-DD, you can add a space before the date to preserve the correct date format.

    Prepare Import CSV

    Prepare your CSV file with the the following column names and corresponding values. Please note that column headings must be exact, and some values can only contain specific values.

    Column Heading: title *required
    Accepted Values: Any letters and/or numbers

    The title column should contain the name that you would like to set as the post title, and can contain any characters that WordPress accepts for the post title.

    Column Heading: company_id *required
    Accepted Values: Company ID (number/integer)

    The company_id column should contain the post ID (number) of the company that should be assigned to the file or invoice post. The company post ID can be obtained by navigating to WordPress Admin -> Client Portal Pro -> Companies -> Company ID Column (for the respective Company)

    Column Heading: excluded_users (optional)
    Accepted Values: Semicolon separated list of user login names

    The excluded_users column should contain a list of usernames (user login names) that should be added as excluded users for the given file or invoice. Separate multiple values with a semicolon (;), and please do not use commas. Usernames can be obtained by navigating to WordPress Admin -> Users -> Username column (for the respective user).

    Column Heading: excluded_roles (optional)
    Accepted Values: Semicolon separated list of user role names

    The excluded_roles column should contain a list of role names (example: “shop_manager”) that should be added as excluded roles for the given file or invoice. Separate multiple values with a semicolon (;), and please do not use commas. Role names can be obtained by inspecting the output of wp_roles()

    Column Heading: status (optional)
    Accepted Values: The file or invoice status slug

    The status column should contain the file or invoice status slug depending on which type of posts you are creating (Example invoice status slug: “paid”; Example: file status slug: “in-progress”. This field is optional, but it may be required in your operation or work flow.

    Column Heading: assigned_product_id (Invoices only – optional)
    Accepted Values: WooCommerce Product ID

    The assigned_product_id column should contain the WooCommerce product ID (number) of the product to associate with the invoice, and is only relevant when importing invoice posts. This column is required if you are intending to associate a product with the invoice. The product ID can be obtained by navigating to WordPress Admin -> WooCommerce -> Products, then locate and hover over the respective product title, and the ID will be visible in the hover menu.

    Column Heading: assigned_product_qty (Invoices only – optional)
    Accepted Values: Any positive integer(example: “2”)

    The assigned_product_qty column allows you to specify a product quantity. If no value is entered, the default value of “1” will be used.

    Column Heading: product_title_override (Invoices only – optional)
    Accepted Values: Any text string title

    The product_title_override column allows you to override the default product name. If no value is specified, the product name will be used.

    Column Heading: category_slugs (optional)
    Accepted Values: Semicolon separated list of file or invoice category slugs

    The category_slugs column should contain a list of file or invoice category slugs depending on which type of posts you are importing. Separate multiple values with a semicolon (;), and please do not use commas. File and invoice category slugs can be obtained by navigating to WordPress Admin -> Users -> Client Files or Client Invoices -> File or Invoice Categories -> Slug column (for the respective category).

    Column Heading: tag_slugs (optional)
    Accepted Values: Semicolon separated list of file or invoice tag slugs

    The tag_slugs column should contain a list of file or invoice tag slugs depending on which type of posts you are importing. Separate multiple values with a semicolon (;), and please do not use commas. File and invoice tag slugs can be obtained by navigating to WordPress Admin -> Users -> Client Files or Client Invoices -> File or Invoice Tags -> Slug column (for the respective tag).

    Column Heading: due_date (optional)
    Accepted Values: Date in YYYY-MM-DD format

    The due_date column should contain a date in the YYYY-MM-DD format if you are choosing to add a due date to the post. Any other date format will not be accepted.

    Column Heading: attached_file_name (optional)
    Accepted Values: Name of an existing file (Example: “test-invoice.pdf”)

    The attached_file_name column should contain the name of a file that already exists in the respective company’s upload directory, if you are choosing to attach a file to the post. Adding a file name here will not upload a new file. Further, the file name should be the name of the file only (Example: “test-invoice.pdf”), and not the file URL.

    Also, please ensure that you have enabled uploads for the type of file that you are attempting to attach ( WordPress Admin -> Client Portal Pro -> General Settings -> Allowed Upload File Types);

    Column Heading: new_post_email_sent (optional)
    Accepted Values: sent or blank

    The new_post_email_sent column can be optionally set to sent to prevent the new post notification email from being sent to the client.

    Column Heading: exclude_from_new_post_emails (optional)
    Accepted Values: exclude or blank

    The exclude_from_new_post_emails column can be optionally set to exclude to prevent the new post notification email from being sent to the client.

    Column Heading: exclude_from_reminder_emails (optional)
    Accepted Values: exclude or blank

    The exclude_from_reminder_emails column can be optionally set to exclude to prevent reminder notification emails from being sent to the client for this specific post.

    Column Heading: post_status *required
    Accepted Values: “publish” or “draft”(or any other defined WordPress post status)

    The post_status column should be set to a WordPress post status. To create the post and publish it, set the status to publish. To create the post as a draft to be published later, set the status to draft.

    Column Heading: post_excerpt (optional)
    Accepted Values: Text and/or basic HTML

    The post_excerpt column can be set, and can include text and/or basic HTML. Important: The content should not include line returns. Any line returns contained within the content may cause errors in your import.

    Column Heading: post_content (optional)
    Accepted Values: Text and/or basic HTML

    The post_content column can be set, and can include text and/or basic HTML. Important: The content should not include line returns. Any line returns contained within the content may cause errors in your import.

    FAQ

    Separate multiple values within a cell.
    For columns/elements that accept multiple values, use a semicolon (;) to separate multiple values. It is important that only semicolons be used, and not commas, as using commas will cause errors when parsing your CSV file.
    Returns/line breaks in content.
    Ensure that none of the values in your CSV file contain returns/line breaks, as this will cause errors when parsing your CSV file.
    Attached file names.
    The CSV import process cannot upload new files to client file directories, so if you enter a value for “attached_file_name” please ensure that the file exists in the respective client file directory (or be sure to upload the corresponding file after the import is complete).
    Pro Tip: Add Additional Columns
    It may be helpful to add additional columns to your CSV file to make it easier to read. For example, it may help you to add a company name column or a product name column that contain easy to read names. These extra columns will be ignored during the import process, and can be safely added to help you shape your import file.

    Get Constellation Client Portal

    Get Started
    ARS