Universal HTML to RO CSVI Exporter is a free, standalone PHP utility that helps migrate website content to Joomla using RO CSVI. It extracts article titles, content, dates, images, categories and custom field values from website HTML and generates a CSV file for Joomla Content import.
The tool is especially useful when migrating older Joomla websites, transferring content from third-party extensions or moving articles from other content management systems to Joomla. No Joomla extension installation is required, and the source website does not need to use Joomla.
Key Features
- Export from multiple article listings or individual article URLs.
- Configurable CSS selectors and XPath expressions.
- Dynamic Joomla Custom Field mapping, including YouTube URL conversion.
- Image downloading and local image path generation.
- Category mapping, flexible introtext and fulltext extraction, and optional source ordering.
- Duplicate URL detection, including redirects and same-site canonical URLs, and alias collision handling.
- Preview and UTF-8 CSV export for RO CSVI.
- Localhost operation and optional password-protected HTTPS live operation.
Requirements
- PHP 8.1 or later with DOM/XML and cURL extensions enabled.
- RO CSVI with Joomla Content import support on the destination website.
- Write access to the selected Joomla image folder if downloading images.
- For live use: HTTPS, working PHP sessions, private writable temporary storage outside the website root, and outbound HTTP/HTTPS and DNS access.
Getting Started
- Download the PHP file and place it in the root directory of the destination Joomla website (where
images/is located). - For localhost, open the PHP file directly in your browser, for example
http://localhost/joomla/universal-html-to-rocsvi-v1.0.3.php. No password is required for direct loopback access. The default configuration is for local development only. - For live hosting, follow the instructions below before uploading the file.
- Use your browser's Inspect tool to identify the HTML selectors on the source website. All extraction settings initially start empty.
- Configure the settings, click Preview first 5 articles, and review the results.
- Click Export CSV and import the file using a Joomla Content import template in RO CSVI.
Using the Exporter on a Live Website
Live access is disabled by default. To enable it, edit the PHP file locally and generate a password hash with PHP CLI (for example, in the XAMPP PHP directory). Use a unique random password of at least 16 characters and no more than 72 bytes. The example below is a placeholder, not a password to reuse. If using a shell command, be aware that command history may retain the plaintext password.
php -r "echo password_hash('YOUR-STRONG-PASSWORD', PASSWORD_DEFAULT), PHP_EOL;"
Copy the generated hash into the following configuration at the top of the PHP file, replacing the placeholder:
const EXPORTER_LIVE_MODE = true;
const EXPORTER_LIVE_PASSWORD_HASH = 'PASTE_GENERATED_HASH_HERE';
Upload the configured file to the destination Joomla root and open its HTTPS URL. Sign in with the original password, not the hash. Use the Sign out button when finished. Do not upload a separate unconfigured localhost copy to a public website.
Live mode requires HTTPS as recognised by PHP. If a reverse proxy terminates TLS, configure the web server to set HTTPS securely; client-supplied forwarding headers are not trusted. Authentication expires after 30 minutes of inactivity. Five failed login attempts block further login attempts for the remainder of a 15-minute window across the installation, including other browsers. A successful login resets the counter when the limit has not been reached.
For security, live downloads are restricted to public HTTP/HTTPS destinations on standard ports 80 and 443. Private, loopback and other non-public IP addresses are blocked, including DNS results, redirects and image downloads. Localhost mode still permits access to local source websites for development. Public source websites can be used in either mode.
Use this as a temporary administrative tool, preferably on a staging site or behind an additional IP restriction. Keep the image folder non-executable and delete the PHP file when the migration is complete.
Configuration Settings
Source Pages
| Setting | Description |
|---|---|
| Mode | Choose Listing pages (category or article lists) or Article detail pages (direct article URLs). |
| Start URLs | One complete source URL per line. Supply additional listing page URLs manually if the source is paginated. |
| Listing container selector | Optional CSS selector for the article list, e.g. .com-content-category-blog. |
| Article link selector | CSS selector identifying article links inside the listing, e.g. .blog-item .page-header h2 a. Provide this or a URL include filter in listing mode. |
| Article URL include filter | Optional text that must appear in an article URL, e.g. /news/. This is not a regular expression. |
| Maximum articles | Limits the number of unique successfully extracted articles. Leave empty or enter 0 for no limit. |
| Keep source ordering | Choose Yes to add the ordering column and preserve source link order within each destination category. |
Article Extraction
| Setting | Description |
|---|---|
| Title selector | Required. Identifies the title in each article page, e.g. h1 or meta[property="og:title"]. |
| Content selector | Identifies the article body, e.g. .com-content-article__body. Leave empty to omit article body content. |
| Date selector | Identifies the source date, e.g. time. The parsed value is written to both created and publish_up. Leave empty to omit these columns. |
| Introtext mode | Controls the division between introtext and fulltext. See options below. |
| Image selector | Identifies the main article image itself, e.g. .item-image img or meta[property="og:image"]. Leave empty to omit image columns. |
| Image handling | Choose whether to retain remote URLs, download images or generate local paths. |
| Image folder | Relative path under images/, e.g. images/imported. Required for download or local path modes. |
| Intro image | Choose Same as full image, Empty to output an empty value, or leave unselected to omit the image_intro column. |
Introtext Modes
- First paragraph (remove from fulltext): Moves the first paragraph into introtext; the remaining content becomes fulltext. If no paragraph is found, introtext remains empty.
- Empty introtext: Stores all content in fulltext.
- All content in introtext only: Stores all content in introtext and leaves fulltext empty.
- Same as fulltext: Stores the same content in both fields (duplicates the content intentionally).
Image Handling
- Keep remote URL: Retains the absolute source image URL.
- Download to local folder: Downloads the selected main image (JPEG, PNG, GIF or WebP) and writes a relative Joomla image path. Filenames are based on image content to reduce collisions.
- Write local path only: Generates a local image path using the original filename, without downloading the image. Use this when the images have already been copied.
Image downloading applies to the selected main article image, not all images embedded in the article body. Embedded image and link URLs are converted to absolute URLs when cleaning HTML.
Joomla Destination
| Setting | Description |
|---|---|
| Source category selector | Optional selector for the category name on the source article page. |
| Parent category | Optional destination parent path for extracted source categories, e.g. News/International. |
| Fallback category path | Destination category when no source category or matching rule is found. |
| Category mapping | Maps source URL keywords or exact source category names to Joomla category paths. One rule per line in keyword=destination/path format. The first matching rule takes priority. |
| State | Published, Unpublished or Archived. Leave unselected to omit the column. |
| Language | Optional Joomla language tag, e.g. en-GB, el-GR or *. |
| Access | Optional numeric Joomla access level ID, e.g. 1. |
| CSV separator | Required. Choose the same separator in RO CSVI: semicolon, comma, pipe or tilde. |
To import every article into a single category, enter its path in Fallback category path and leave the other category settings empty. For more complex migrations, use category mapping:
news=News
desserts=Recipes/Desserts
announcements=News/Announcements
Custom Fields
Click Add custom field to create as many mappings as needed. Custom fields must already exist in the destination Joomla website and be available in RO CSVI.
| Setting | Description |
|---|---|
| Joomla field name / CSV column | The exact custom field name (alias) recognised by RO CSVI, not its display title. Use letters, numbers, hyphens or underscores; no spaces. |
| Source selector | CSS selector or XPath identifying the source value. |
| Extraction type | Text extracts plain text; Inner HTML extracts cleaned HTML; HTML attribute extracts an attribute value; Attribute as absolute URL converts a URL attribute into an absolute URL; YouTube URL converts supported YouTube video URLs to standard watch URLs. |
| Attribute name | Required for HTML attribute, Attribute as absolute URL and YouTube URL extraction, e.g. src, href or content. |
For example, enter recipe as the Joomla field name, .recipe-instructions as the source selector and Inner HTML as the extraction type. Each mapping adds a CSV column. Missing values remain empty.
The first matching node is used, even if its value is empty. CSS selectors support tags, classes, IDs, attribute matching and descendant or direct-child relationships. Advanced selections can use a single XPath expression prefixed with xpath:.
Example: Importing YouTube Videos from JoomlaWorks AllVideos
Older Joomla websites may display YouTube videos through the AllVideos plugin. For example, the source article may contain the following HTML (simplified):
<span class="itemVideo">
<iframe src="https://www.youtube-nocookie.com/embed/NZjYyL24NxM?rel=0&fs=1&wmode=transparent"></iframe>
</span>
Create a destination Joomla custom field (for example, a Text or Textarea field with the name video-text-url) and configure the exporter as follows:
| Setting | Value |
|---|---|
| Joomla field name / CSV column | video-text-url (use your actual RO CSVI column name) |
| Source selector | .itemVideo iframe |
| Extraction type | YouTube URL |
| Attribute name | src |
The YouTube URL option supports standard watch links, embed URLs (including youtube-nocookie.com), youtu.be share links, Shorts and live video links. It removes extra query parameters and returns only the standard watch URL. Missing or unsupported video URLs remain empty. For a regular video link in an anchor element, select the anchor and use href instead of src. Videos are not downloaded.
CSS Attribute Selector Examples
| Selector | Matches |
|---|---|
a[href*="youtube.com"] |
Links whose href contains youtube.com. |
iframe[src^="https://www.youtube-nocookie.com/embed/"] |
Iframes whose src begins with the specified URL. |
img[src$=".jpg"] |
Images whose src ends with .jpg. |
Attribute value matching is case-sensitive. These examples work in any selector field. For more complex selectors use XPath.
RO CSVI Configuration
Create or edit a Joomla Content import template and configure the following settings:
| Setting | Value |
|---|---|
| Operation | Import |
| Component | Joomla Content |
| Use file for configuration | Yes |
| Field separator | Same as the exporter, e.g. ; |
| Text enclosure | " |
| Category separator | / |
If custom fields are not recognised, use Update Available Fields in RO CSVI.
Preventing Duplicate Imports
The exporter checks article URLs, redirects and same-site canonical URLs within each export. Numeric IDs in URL-based aliases are retained, and alias collisions within the same destination category are handled automatically. Detection is not a database check, and incorrectly configured canonical URLs or changed aliases may affect matching.
To skip existing Joomla articles during subsequent imports, open the RO CSVI import template, select the File tab and click the Advanced button in the top toolbar (confirmed in RO CSVI 9.12.1).
| Setting | Value |
|---|---|
| Overwrite existing data | No |
| Skip new items | No |
RO CSVI matches existing articles using their alias and category path. Keep both values stable for repeated imports. Test with a small CSV before importing a large number of articles.
For more information, see the RO CSVI File tab documentation.
Preview and Export
Preview first 5 articles displays up to five successfully extracted rows and the number of duplicate URL references encountered. Preview may also download selected images if download mode is enabled. Export CSV runs the extraction again and generates the CSV file. If an article fails during export, correct the extraction errors before retrying.
Important Notes
- The exporter works with server-rendered HTML. JavaScript-only content, login-protected sources and automatic pagination crawling are not supported.
- HTML is cleaned during extraction; inline styles, scripts and embedded iframes are removed. Review imported content before publishing it.
- Large exports may exceed PHP execution time, memory, or hosting limits. Use smaller batches and back up the destination website before importing.
- CSV data is intended for RO CSVI, not spreadsheet formula execution. Treat source data as untrusted when opening CSV files in spreadsheet applications.
- Only migrate content that you own or are authorised to transfer.
License and Availability
Universal HTML to RO CSVI Exporter is available as a free download under the GNU General Public License version 2 or later.
It is an independent migration utility designed to work alongside RO CSVI and is not an official RO CSVI extension.