Overview and Detailed Guide to the «Import Articles from CSV/Excel to Page Module» Plugin for Cotonti CMF
The pageimportcvsexcel plugin is a professional tool developed specifically for the Cotonti content management system (version 0.9.26 and higher), which allows administrators to quickly and conveniently transfer large volumes of articles from Excel tables (XLSX) and CSV files into the Page module.
Video in Telegram | Video in YouTube
Tested on Cotonti 0.9.26+ with PHP 8.4
The plugin is fully standalone: it does not require Composer installation, uses the built-in latest stable version of the PhpSpreadsheet library, and works on PHP 8.4+. It is ideal for migrating content from other CMS platforms, importing articles from parsers, supplier Excel tables, or internal databases.
Key Features
- Support for the two most popular formats: XLSX and CSV.
- Flexible field mapping: the administrator independently matches Excel columns to any fields in the cot_pages table (title, text, desc, keywords, metatitle, alias, category, dates, author, etc.).
- Automatic date processing (both in Excel format and regular strings).
- Built-in text cleaning: optionally removes all links, scripts, JavaScript events, data- and javascript-schemes, empty tags — excellent protection against "dirty" content.
- Limit on the number of imported rows (configurable, default 300).
- Detailed logging of all stages (optional).
- Convenient modern Bootstrap 5-based interface with tabular field mapping display.
- Automatic default value insertion and protection against empty required fields (category and title).
- If the page_text field remains empty, the plugin automatically fills it with the article title.
- Complete cleanup of temporary files after import.
Installation and Activation
- Copy the pageimportcvsexcel folder to the /plugins/ directory.
- In the administration panel, go to Extensions → Plugins and install the plugin.
- Activate it and assign rights to the "Administrators" group (RW).
The plugin automatically creates an uploads/ folder inside its directory and uses the session to store the path to the uploaded file.
Plugin Configuration
In the Plugin Configuration section, five key parameters are available:
- Target table — default is pages (you can specify any other table with a similar structure).
- Maximum rows — import limit (0 = no limit).
- Allowed formats — xlsx,csv (can be expanded or restricted).
- Strip links in text — enable HTML cleaning function.
- Keep import log — detailed journal in logs/import.log file.
Step-by-Step Usage Guide
Step 1. File Preparation Prepare the table in Excel or Google Sheets. The first row contains column headers (they can be in any language). Recommended columns: Title, Text, Short Description, Category, Alias, Publication Date, Author, Keywords, Meta Title, etc.
Step 2. File Upload Go to Administration → Others → Page Module articles CSV/Excel Import. Select the file and click "Upload File". The plugin checks the format, saves the file to a temporary folder, and automatically reads the column headers.
Step 3. Field Mapping Setup A convenient table appears: on the left — all available Page module fields (with clear labels). On the right — a dropdown list with your file's headers + the "Do Not Import" option.
Select the necessary mappings (most fields can be left on default auto-mapping). Click "Start Import".
Step 4. Import Process The process runs row by row. Upon completion, you will see the exact number of successfully added records. The file is automatically deleted, and the session is cleared.
Useful Tips and Best Practices
- For very large files (over 1000 rows), set a reasonable row limit and run the import in multiple batches.
- Enable the link cleaning function when importing content from external sources — this significantly improves security and article quality.
- Keep the import log enabled during initial runs — it helps quickly identify and fix data issues.
- If the file contains an alias column, be sure to map it to page_alias — the plugin does not automatically check uniqueness.
- For dates, it is better to use “DO NOT IMPORT”.
Technical Features and Reliability
The plugin uses a modern approach: reads only data (without styles), processes row by row, protects against SQL injections via Cotonti's standard $db->insert() methods. The PhpSpreadsheet library autoloaders and PSR work without conflicts with other plugins.
All exceptions are caught and logged, and the user receives clear error messages. No "garbage" remains on the server after import.
Who the Plugin Is For
- Owners of large Cotonti-based sites who need to regularly add hundreds of articles.
- Developers and freelancers performing content migrations.
- Online stores and information portals using Excel as their main article database.
- Anyone tired of manually creating hundreds of pages.
Conclusion
pageimportcvsexcel is a mature, well-thought-out, and secure tool that saves dozens of hours of routine work. It combines maximum mapping flexibility with a user-friendly interface and reliable data processing. Thanks to the absence of external dependencies, the plugin works "out of the box" even on the strictest hosting environments.
If you actively use the Page module in Cotonti — this plugin should be in your arsenal. It is already production-ready and will be useful for both beginners and experienced administrators.
Permanent link to the current plugin source code on GitHub.
Official support and discussion page: https://abuyfile.com/ru/forums/cotonti/custom/plugs/topic123
Author: webitproff (February 2026).