Skip to content
CodeAstrology
Working Hours 9:30 am - 6:30 pm (Sun - Thu)
Contact Us contact@codeastrology.com

Special Discount!

Use coupon code WP20

CodeAstrology

CodeAstrology

We Develop and Sell WordPress Plugins and Themes

  • Home
  • About
    • Services
    • Company
    • Team
  • Products
    • Premium Products
    • Free Products
    • Woo Product Table
    • Min Max Quantity & Step Control
    • UltraAddons
    • Pricing – Add to cart button Changer
  • Blog
  • Contact
  • My Account
    • Support Area
    • Affiliate Area
 0 - $0.00
Get Quote
Wordpress failed
By Jakir Hossain

WordPress Failed To Import Media? 5 Reasons Those Errors Happen.

Creating content can be a hard task, but it doesn’t have to be as difficult as you might think. Sometimes WordPress failed to import images or media documents, or other files that are needed for web pages and posts.

When you’re publishing a blog post, you receive an error that says “WordPress Failed To Import Media?” or “Failed To Import The Media You Selected.” This article breaks down the situation and provides five easy resolution tips to help you get back on track.

Table of Contents

  • Why Did WordPress Fail To Import Media? 5 Reasons Why These Errors Happen.
  • Reason 1: PHP Memory Limited
  • Reason 2: File and Folder Permissions
  • Reason 3: Broken URLs
  • Reason 4: Broken XML File
  • Reason 5 : Large XML File
  • Final Thoughts

Why Did WordPress Fail To Import Media? 5 Reasons Why These Errors Happen.

In this article, you will learn the five most common WP errors that occur when importing files from your local computer to your WordPress site. The article outlines what each of these error messages means and, usually, how to fix the problem in less than 5 minutes!

Reason 1: PHP Memory Limited

WordPress gives you the ability to upload a file in sections if you wish to submit a huge file to your website. However, if you are attempting to upload something that is really large, the maximum size for an individual file attachment may be insufficient for the task. This is often the result of PHP’s low memory limit on the size of files that can be uploaded. If you wish to be able to upload files that are larger than a certain size and are hosting your own website, you will need to adjust the Maximum Upload Size setting in cPanel.

TO SOLVE THIS PROBLEM:

 Step 1: Access your cPanel dashboard

          Step 2: Select PHP Version

The PHP Version can be accessed in cPanel’s Software Area. If not, look at the advanced section. Here, modify your server’s PHP version. choose a PHP version.

cpanel

    Step 3: PHP Options Panel

PHP ini

Step 4: Max Values Set

You’ll then find PHP extensions for the current version.

Scroll down to find the upload_max_filesize, post_max_size, memory_limit, max_execution_time, and max_input_time parameters.

We must increase the value of upload_max_filesize.

upload_max_filesize

Reason 2: File and Folder Permissions

Web hosting providers sometimes upgrade and change file permissions.

If the authorization mode doesn’t allow file uploads, this error may appear:

‘Cannot build wp-content/uploads/20../0. Is the server writable in the parent directory?

TO SOLVE THIS PROBLEM:

Use FTP. Open wp-content/uploads.

Right-clicking it displays ‘File permissions. For all folders and subfolders, set 755.

File permissions

Right-clicking it displays ‘File permissions. For all folders and subfolders, set 755.

Next, editing uploads file permissions. All files should use 644.

Reason 3: Broken URLs

Many complications arise when transferring WordPress to a new host. After switching, images may not appear properly.

The XML file you upload to WordPress Importer simply contains the file’s URL, not the file itself. This means the importer downloads images from the former site/blog. If the old source is gone, the importer plugin throws an error.

Open the media in your browser to see whether it’s still available. Open the XML file you’d upload in a text editor to obtain the media’s URL. It must have this code:

<script src="https://gist.github.com/codeastrology-dev/40008a4477564a2dec60a8d94f4653c3.js"></script>

Each < item > element’s wp:attachment url> is key.

It includes the old media’s URL. 

In this example, the URL is

https://codeastrology.com/wp-content/uploads/image-835634856_324234.jpg?sc=56,

which you can check in your browser.

TO SOLVE THIS PROBLEM:

If you can’t access the file, run the WordPress importer again.

Reason 4: Broken XML File

You might run into problems while attempting to import a massive XML database, demo material from theme imports, or an entire website’s worth of content into WordPress.

TO SOLVE THIS PROBLEM:

Download the file again. So go to the, 

WordPress Dashboard >> Tools >> Export >> Download Export File

Download Export File

Reason 5 : Large XML File

You may have updated the file upload size (upload_max_filesize) as well as the max_execution_time and max_input_time, but you still receive the error message. Why?

Because your file is too large. You need to divide the file into small chunks.
TO SOLVE THIS PROBLEM:

Step 1: Text Editor

I use Coda or Sublime Text, but any will do. DO NOT USE MS WORD or other “word processing” programs. It’s a simple text editor like Notepad.

Step 2: Exclude Instructions Lines

Instructions are the first 20 lines. They’re useless. 

Critical is the

<?xml version=”1.0″ encoding=”UTF-8″ ?>

tag on the first line.

Content begins where rss version=”2.0″… and channel> tags appear.

Follow the pattern carefully. In addition to the above tags, each line must contain… tags. 

Each new part must be tagged as shown:

<?xml version="1.0" encoding="UTF-8" ?>
<rss version="2.0"...
<channel>
<wp:wxr_version>1.2</wp:wxr_version>
Your 5,000-ish lines of content, starting with <item> and ending with </item>
</channel>
</rss>

You should have numerous item>…/item> tags in 5,000 lines. The import will fail if your content isn’t wrapped in item>…/item> tags.

Step 3: Copy and Paste Tags

Copy and paste these tags into each file’s top and bottom. The process will fail if errors are made.

Step 5: Import Small File

It is time to upload the small files.
Access your admin dashboard then.

 Tools > Import > WordPress (Run Importer).

Run Importer

Related Article

What To Do When You activate A WordPress Theme But It Doesn’t Work
How to increase Maximum Upload size in cPanel
How to Remove Leave a Reply on the WordPress Site
How to Prevent WordPress Website from Hacking with 11 Effective Methods
How to Transfer WordPress Site from Subdomain to Main Domain
7 Proven Methods for WordPress Elementor Not Loading

Final Thoughts

One of the most frustrating Drupal issues you can experience is failing to import media. In this post, I will go over five reasons why WordPress failed to import your media and how you can overcome them. 

If you’re having trouble importing media into your WordPress site, there are a few things you can do to troubleshoot the issue. Here is the summary of the reasons why: 

  1. Your file size is big but your PHP memory is low. So you have to increase the file upload size and also the max execution time.
  2. You may not have the correct permissions set on your images and videos. Make sure that you’ve granted access to the appropriate files and directories in your WordPress site’s file structure and then try importing again. 
  3. Many complications arise when transferring WordPress to a new host. After switching, images may not appear properly. Because of the broken URL, you have to fix it. The best solution is to clean your cache and re-import them.
  1. You might have pasted the incorrect file type into your media uploader page. Make sure that you’re using the correct file types when uploading media (.jpg, .gif, etc.), and double-check that all of your files are properly named and numbered.
  2. WordPress does not allow you to import large XML files. In that case, you have to divide it into small parts,

After reading this article, you should be able to fix WordPress media import errors on your own without having to contact support. 

Tips and Tricks WordPress

Share

Post navigation

Previous: WordPress Docker Tutorial: How To Setup Your WordPress Site Using Docker
Next: Important Tips to Improve Your Website UX
Trustpilot

Free Plugins

Woo Product Table (Free Version)

Checkout Added to cart

Min Max Quantity & Step Control (Free)

Checkout Added to cart

UltraAddons Elementor (Free)

Checkout Added to cart

Premium Plugins

Woo Product Table Pro

  • Billed once per year until cancelled

  • Billed once per year until cancelled

  • Billed once per year until cancelled

Checkout Added to cart

Min Max Step Control Pro

  • Billed once per year until cancelled

  • Billed once per year until cancelled

  • Billed once per year until cancelled

Checkout Added to cart

Recent Posts

  • WooCommerce product page customization [How to+ Tips]
  • Top 10 Programming Languages for 2023
  • Payment Gateways – Integral Paradigm of Trends and Developments in Online Banking
  • The Customer is Always Right or Are They? 5 Tips on How to Handle Toxic Clients
  • Top 15 ChatGPT alternatives you can use in 2023
  • Top 5 Must-Follow Trends of Digital Marketing in 2023
  • Node.js vs PHP: Comparing – 2023
  • Common Mistakes in Software Development and Ways to Avoid Them
  • Top five WordPress Page Builders
  • What is a Woo Product Table?
  • The 7 Principles of Conversion-Centered Landing Page Design
  • Potential analysis of social media channels in relation to the success of customer retention
  • How To Fix Common SSL Issues in WordPress

Categories

  • Advanced Custom Fields
  • Advanced Search
  • Business Idea
  • Custom Fields WooCommerce
  • Custom Taxonomy
  • E-Commerce
  • Errors
  • Featured Tutorial
  • Instant Search
  • Min Mx
  • Multiple Product to Cart
  • News
  • Online Business
  • Personal
  • PHP
  • Plugin
  • Product Variation
  • Programming
  • Quick Buy
  • Theme
  • Tips and Tricks
  • Uncategorized
  • Woo Product Table pro
  • WooCommerce
  • WooCommerce Filter
  • WooCommerce Product Table
  • WooCommerce Product Table Free
  • Wordpress
Trustpilot

Subscribe to our Newsletter

Resources

  • Support
  • Coupons
  • Blog & News
  • Write For Us
  • Video Tutorials
  • Affiliate Program

Company

  • Our Service
  • Get Quote
  • Refund Policy
  • Privacy Policy
  • Support Policy
  • Terms of Service

Powered By

© 2022, CodeAstrology. All Rights Reserved.
  • Privacy Policy
  • Terms of Service
We use cookies on our website to give you the most relevant experience by remembering your preferences and repeat visits. By clicking “Accept All”, you consent to the use of ALL the cookies. However, you may visit "Cookie Settings" to provide a controlled consent.
Cookie SettingsAccept All
Manage consent

Privacy Overview

This website uses cookies to improve your experience while you navigate through the website. Out of these, the cookies that are categorized as necessary are stored on your browser as they are essential for the working of basic functionalities of the website. We also use third-party cookies that help us analyze and understand how you use this website. These cookies will be stored in your browser only with your consent. You also have the option to opt-out of these cookies. But opting out of some of these cookies may affect your browsing experience.
Necessary
Always Enabled
Necessary cookies are absolutely essential for the website to function properly. These cookies ensure basic functionalities and security features of the website, anonymously.
CookieDurationDescription
cookielawinfo-checkbox-analytics11 monthsThis cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Analytics".
cookielawinfo-checkbox-functional11 monthsThe cookie is set by GDPR cookie consent to record the user consent for the cookies in the category "Functional".
cookielawinfo-checkbox-necessary11 monthsThis cookie is set by GDPR Cookie Consent plugin. The cookies is used to store the user consent for the cookies in the category "Necessary".
cookielawinfo-checkbox-others11 monthsThis cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Other.
cookielawinfo-checkbox-performance11 monthsThis cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Performance".
viewed_cookie_policy11 monthsThe cookie is set by the GDPR Cookie Consent plugin and is used to store whether or not user has consented to the use of cookies. It does not store any personal data.
Functional
Functional cookies help to perform certain functionalities like sharing the content of the website on social media platforms, collect feedbacks, and other third-party features.
Performance
Performance cookies are used to understand and analyze the key performance indexes of the website which helps in delivering a better user experience for the visitors.
Analytics
Analytical cookies are used to understand how visitors interact with the website. These cookies help provide information on metrics the number of visitors, bounce rate, traffic source, etc.
Advertisement
Advertisement cookies are used to provide visitors with relevant ads and marketing campaigns. These cookies track visitors across websites and collect information to provide customized ads.
Others
Other uncategorized cookies are those that are being analyzed and have not been classified into a category as yet.
SAVE & ACCEPT