# Start New Polylang Translations With the Original Content

> Pre-fills the title, content and excerpt of a new translation with the source post's text when you click the "+" icon in Polylang, so translators can work over the original instead of an empty editor.

- Type: PHP
- Runs: Admin only
- Category: [Multilingual](https://wpide.com/library/category/multilingual/)
- Tags: polylang, translations, editor
- Author: WPIDE Team
- Installs: 0
- Updated: 2026-10-28
- Page: https://wpide.com/library/pll-copy-content-to-new-translation/

## Code

```php
$wpide_source = function () {
    if ( empty( $_GET['from_post'] ) || empty( $_GET['new_lang'] ) || ! function_exists( 'pll_get_post_language' ) ) { // phpcs:ignore WordPress.Security.NonceVerification
        return null;
    }

    $post = get_post( absint( $_GET['from_post'] ) ); // phpcs:ignore WordPress.Security.NonceVerification

    return $post && current_user_can( 'edit_post', $post->ID ) ? $post : null;
};

add_filter( 'default_title', function ( $title ) use ( $wpide_source ) {
    $post = $wpide_source();
    return $post ? $post->post_title : $title;
} );

add_filter( 'default_content', function ( $content ) use ( $wpide_source ) {
    $post = $wpide_source();
    return $post ? $post->post_content : $content;
} );

add_filter( 'default_excerpt', function ( $excerpt ) use ( $wpide_source ) {
    $post = $wpide_source();
    return $post ? $post->post_excerpt : $excerpt;
} );
```

## Notes

Polylang's free version already copies taxonomies and custom fields; this adds the text. Only works for posts the user can edit.

## How to use it

Install the free WPIDE plugin (https://wordpress.org/plugins/wpide/), find "Start New Polylang Translations With the Original Content" in its snippet library and add it in one click; or create a new PHP snippet in WPIDE (or any code snippets plugin) and paste the code above. More snippets: https://wpide.com/library/
