Under the new tax law, trading farmland is allowed using a 1031 exchange to defer the tax. However, in order for it to be completely tax free, it usually must include only land or items that constitute real estate. When land includes tiling, wells, etc. these items are likely to be treated as non-real estate and thus will be fully taxable, even if you trade for other farm land.
However, if the other farmland also includes these same items and the value of those items is equal to or greater than what you "sold", the income tax effect will likely be a wash. However, this is not always true.
Let's look at some examples:
A farmer sells farm land worth $1 million. The farmer purchased it for $100,000 many years ago. If he sells for cash, the gain is $900,000 and subject to capital gains taxes. However, if he trades it for other farm land worth $1 million, there is no tax due.
Now, let's assume the farmer put tile into the land at a cost of $100,000 and when the sale is done, the value is still $100,000. This now means the farmland value is $900,000 which can be rolled over tax-free into the new land, however, the farmer will now owe ordinary tax on the $100,000 tile sale. This gain will be eligible for the new 20% Section 199A deduction (subject to possible limitations).
If the new farmland has tile worth $100,000, the farmer can roll over the land gain tax free, report a gain on the tile sale of $100,000 and fully deduct the tile on the new farmland of $100,000 using 100% bonus depreciation (or Section 179 if available).
However, if the farmer is in a state that does not allow bonus depreciation and limits Section 179, he may now owe tax on the tile sale, but only be able to deduct about $5,000 of the new tile for state income tax purposes.
Even if tile is considered real estate under state law, it is still Section 1245 property for income tax purposes so it will likely be fully taxable unless it is rolled into like property.
As you can sell, doing a 1031 exchange on farmland is now more complicated since most farmland is usually not strictly land.